When I read Doug’s message. I figured it was sarcasm related to the voluminous warnings
that are generated these days and was harkening back to some paper Lorinda Cherry wrote
about how they were needless additions to the perfection that was the original C compiler
(that’s sarcasm) that I had never seen before. When you responded as you did, i began to
realize the error of my conception :). If I’m. understanding now, Doug wants to resurrect
the Writer’s workbench amalgamation of tools, most of which were written by Lorinda Cherry
and he’s wanting to eliminate all of gcc’s warnings. I suppose Lorinda Cherry might
actually have approved of -Wall in principle, as there is a strong parallelism between
grammars here.
When I teach student to use -Wall (with clang), I tell them that it’s very handy to see
all of the warnings, but to only address those that they feel are value add, so to speak.
I give the same advice to the writers I advise... just cuz Word tells you not to use
passive voice, doesn’t mean that it isn’t often appropriate. One specific gcc/clang
warning that I get a lot goes like this:
while(entry = getutxent()){
// Do stuff with entry;
}
Sure, it’s a tricky bit, but the printed fix is to add a set of do nothing parens:
while((entry = getutxent()))
Hardly edifying :).
Much better would ve the explicit compare:
while((entry = getutxent()) != NULL)
But even that implies the programmer isn’t capable of differentiating = and ==.
That said, most -Wall stuff is ok, and I’d love to see an up to date wwb kit with few to
no warnings!
Good luck,
Will
Sent from my iPhone
On Sep 20, 2020, at 1:42 PM, arnold(a)skeeve.com wrote:
Doug McIlroy <doug(a)cs.dartmouth.edu> wrote:
I would like to revive Lorinda Cherry's
"parts".
Implicit in "revival" is dispelling the hundreds
of warnings from gcc -Wpedantic -Wall -Wextra.
Has anybody done this already?
Doug
I haven't tried this. I do suggest starting with 'gcc -m32' so that
you're not fighting 64 bit issues at the same time as everything else.
HTH,
Arnold