This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]