[TUHS] Minimum Array Sizes in 16 bit C (was Maximum)

Steffen Nurpmeso steffen at sdaoden.eu
Wed Oct 2 10:55:58 AEST 2024


Rik Farrow wrote in
 <CACY3YMGcSm+ATwbz1TmKKoOQeKCPsoTnT4u93vFdKpZyyHCZ7A at mail.gmail.com>:
 |On Tue, Oct 1, 2024 at 12:07 PM <arnold at skeeve.com> wrote:
 |> Bakul Shah via TUHS <tuhs at tuhs.org> wrote:
 ...
 |>> Sounds like boomer mentality... Kids these days... :-) Also sounds like
 |>> the kind of arguments assembly language programmers presented when *we*
 |>> were the "kids" trying out "structured programming"!
 |>
 |> It's not that they're intrinsically unqualified. They were never
 |> taught, so they don't know what they're doing. I'm unqualified to
 |> fly a plane because I never learned or practiced, not because I'm not
 |> intelligent enough.  Same thing for many of today's programmers
 |> and C / C++.

 |And my comment about seeing code produced by programmers while doing sales
 |support dates from 1990. This isn't something new, from my perspective. I
 |was working in a small programming shop where there were a handful of
 |excellent programmers, and then sent out to help customers get started
 |using their libraries. That's when I experienced seeing things that still
 |make me cringe.

Btw the "official Linux firmware"

  https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary

introduced a dependency for the "rdfind" utility i think ~two
years ago (it was later made optional) for this code:

        $verbose "Finding duplicate files"
        rdfind -makesymlinks true -makeresultsfile false "$destdir" >/dev/null
        find "$destdir" -type l | while read -r l; do
                target="$(realpath "$l")"
                $verbose "Correcting path for $l"
                ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l"
        done

I proposed (because it really drove me mad, i have nothing to do
with Linux kernel stuff etc shall you think that)

    (
    cd "$destdir" && find . -type f | xargs cksum | sort | {
        ls= lf=
        while read s1 s2 f; do
            s="$s1 $s2"
            #$verbose $s $f
            if [ "$s" = "$ls" ] && cmp "$lf" "$f"; then
                $verbose 'duplicate '"${lf##*/}" "${f#./*}"
                rm -f "$f"
                #ln -s "${lf#./*}" "${f#./*}"
                ln -s "${lf##*/}" "${f#./*}"
            else
                ls=$s
                lf=$f
            fi
        done
    }
    )

(as a draft, with only light testing, but it is not far from doing
it at maximum) which only uses POSIX default tools etc, but these
guys from very big companies (RedHat; the guy who did *that* is
from AMD) did not even respond, at least to that.
(At times i tried to get rid of rsync dependency of kernel
makefile officially, as that can also be done via plain shell
tools, they at least answered "what is wrong with rsync".)
Maybe because the patch also included

  -            compress="zstd --compress --quiet --stdout"
  +            compress="zstd -T0 --ultra -22 --compress --quiet --stdout"

but that only brought the firmware into line with the normal Linux
kernel make zstd usage.  I will never know.

I think what i am trying to say is that maybe "time is money" in
addition to anything else.  (I never heard about rdfind though.
Btw its manual (it has one!) says
  SEE ALSO
       md5sum, sha1sum, find, symlinks
were cksum is a standard tool.  So it is.  Everyone its own
infrastructure, how large it is; you all only get the binary
updates anyway, my Linux distribution compiles from source; and
what the mesa library alone has grown in new dependencies that are
mostly never needed let alone at runtime, like YAML, that has been
done at release-tarball-creation time in the past.  At least
here.)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the TUHS mailing list