From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3305 invoked by alias); 20 Mar 2003 18:44:55 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3284 invoked by uid 48); 20 Mar 2003 18:44:54 -0000 Date: Thu, 20 Mar 2003 18:44:00 -0000 Message-ID: <20030320184454.3283.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, xkinh@yahoo.com From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, xkinh@yahoo.com, gcc-gnats@gcc.gnu.org Subject: Re: c/10170: Is this a bug of GCC? or it's a C syntax X-SW-Source: 2003-03/txt/msg01345.txt.bz2 List-Id: 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