:: Re: [DNG] What is the meaning of th…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Rainer Weikusat
Ημερομηνία:  
Προς: Didier Kryn
Υ/ο: dng
Αντικείμενο: Re: [DNG] What is the meaning of this gcc warning?
Didier Kryn <kryn@???> writes:
> Le 19/10/2015 16:09, Rainer Weikusat a écrit :
>> 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 ...

>
>     Writing  "if (a = b)" when meaning "if (a == b)" is a very easy
> mistake.


Not 'easier' than accidentally confusing 'murder' and 'murderer' in
English when coming from a German background: The German 'Moerder' is
the same as the English 'murderer' and the German translation for
'murder' would be 'Mord' while 'Moerderer' doesn't make any sense.

Astoundingly difficult stuff like that is routinely expected from fifth
or sixth form puplis and draconically punished when done wrong.

[...]

> or do you mean this Mr Wirth you seem to disaprove is (one
> of) the authors of gcc?


I'm just tired of this 40+ year old language war.