:: Re: [DNG] What is the meaning of th…
Top Pagina
Delete this message
Reply to this message
Auteur: Rainer Weikusat
Datum:  
Aan: dng
Onderwerp: Re: [DNG] What is the meaning of this gcc warning?
Edward Bartolo <edbarx@???> writes:
> Could someone explain to me what is the meaning of this error and what
> I should do to avoid having this warning?
>
> edbarx@edbarx-pc:~/netman/backend_src/src$ gcc -Wall -Wfatal-errors -g
> -lm -I../include core_functions.c file_functions.c backend.c
> essid_encoder.c automated_scanner.c -o backend
> automated_scanner.c: In function ‘autoWirelessScanPlus_RN’:
> automated_scanner.c:521:2: warning: suggest parentheses around
> assignment used as truth value [-Wparentheses]
> if ( dir = opendir(IFACES_PATH) ) {
> ^


The warning really only communicates that - ca 42 years ago - some
... American (!!1) dared to do something Nikolaus Wirth strongly
disapproved of, namely, make assignment an expression instead of a
statement (something Mr Wirth already strongly(!!2) disapproved of the
the context of Algo 68) and then didn't use the assignment operator Mr
Wirth had approved of (!!3), namely, :=.

I don't know if this is the oldest, entirely pointless "programming
language syntax war" in existance but it's surely one of the most
persistently annoying ones[*].

[*] Sometimes, when noticing that everyone else is driving in the
    opposite direction on a motorway, you're actually wrong yourself ...