c/10170: Is this a bug of GCC? or it's a C syntax

bangerth@dealii.org bangerth@dealii.org
Thu Mar 20 19:29:00 GMT 2003


Synopsis: Is this a bug of GCC? or it's a C syntax

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Thu Mar 20 18:44:53 2003
State-Changed-Why:
    Your code is perfectly legal: you take the address of a
    function and in the if-statement, it is implicitly compared
    against zero. Since the function's address is non-zero, 
    the printf-branch is executed.
    
    Other compilers will certainly not give you errors on this
    code, since it is legal. They may give you warnings, as
    icc does here, for example:
    g/x> icc x.c
    x.c(4): warning #279: controlling expression is constant
        if (alwayzero)
            ^
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10170



More information about the Gcc-bugs mailing list