bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CLANG10 interesting warning !


From: Domingo Alvarez Duarte
Subject: Re: CLANG10 interesting warning !
Date: Fri, 17 Jul 2020 17:32:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hello Andrew !

Thanks again for reply !

I know the meaning of the warning, what I'm not sure is the meaning/intention of the writer of that piece of code !

Is it clear for you ?

Cheers !

On 17/7/20 17:28, Andrew Makhorin wrote:
On Fri, 2020-07-17 at 16:53 +0200, Domingo Alvarez Duarte wrote:
Hello !

When compiling with CLANG10 we get this warning:

=====

   clang -DHAVE_CONFIG_H -I. -I.. -I. -I./amd -I./api -I./bflib
-I./colamd -I./draft -I./env -I./intopt -I./minisat -I./misc -I./mpl
-I./npp -I./proxy -I./simplex -I./zlib -g -O3 -march=native -DNEBUG
-DWITH_SPLAYTREE -flto
-I/home/mingo/local/clang-10/lib/clang/10.0.0/include
-I/home/mingo/local/clang-10/include -I/home/mingo/local/include -MT
libglpk_la-spxprim.lo -MD -MP -MF .deps/libglpk_la-spxprim.Tpo -c
simplex/spxprim.c  -fPIC -DPIC -o .libs/libglpk_la-spxprim.o
simplex/spxprim.c:1526:7: warning: add explicit braces to avoid
dangling
else [-Wdangling-else]
        else
        ^
1 warning generated.

This is a well-known syntactic problem dated back to Algol 60.

The statement:

        if A then if B then C else D

can be interpreted in two ways:

        if A then (if B then C) else D

        if A then (if B then C else D)

However, this disambiguation doesn't appear in C due to its more
perfect grammar.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]