From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12099 invoked by alias); 20 Mar 2003 21:26:00 -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 12083 invoked by uid 71); 20 Mar 2003 21:26:00 -0000 Date: Thu, 20 Mar 2003 21:26:00 -0000 Message-ID: <20030320212600.12082.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Kinh Nguyen Subject: Re: c/10170: Is this a bug of GCC? or it's a C syntax Reply-To: Kinh Nguyen X-SW-Source: 2003-03/txt/msg01351.txt.bz2 List-Id: The following reply was made to PR c/10170; it has been noted by GNATS. From: Kinh Nguyen To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c/10170: Is this a bug of GCC? or it's a C syntax Date: Thu, 20 Mar 2003 13:21:37 -0800 (PST) I totally agree with you about the C syntax and the way GCC handles it. I just hope the GCC would detect and give a warning so life would be easier for C programmers. I made a mistake in typing when I modified a big program. It gave me a lot of head-ache to figure out the problem. Thanks Kinh --- bangerth@dealii.org wrote: > 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 __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com