🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6184

Re: gcc 2.7.2 bug on hp machine

#6184
From: Craig M. Buchek
Date: Sun, 24 Nov 1996 00:00
39 lines
1659 bytes
Wern-Jieh Sun wrote:
 
> The following is a small c program showing a gcc 2.7.2 bug on hp machine.
> The routine a() is not called on a hp machine.
> It works fine on SunOS machine.

> int smode;
> 
> #define FPGA    (1 << 2 )
> #define SMODE( m)      ( smode & (m) )
               ^^^^
> a()
> {
>   printf("no bug\n");
> }
> 
> main()
> {
>   smode = 0 ;
> 
>   if( ! SMODE(FPGA) ) {
>   }
> 
>   a();          /* a() is not called on a hp machine */
> }

It looks like the preprocessor is having a problem with the space after
the opening parenthesis in the macro definition.  Try dumping the
preprocessor output with "gcc -E t.c".  My GCC 2.7.2.1 on Linux/i386
gives correct output.  I'm not sure what ANSI C says, but I think the
compiler does in fact have a bug.  I know that if you put the space
*before* the opening parenthesis, the macro SMODE would expand into "(m)
( smode & (m) )".

Hope this helps,
Craig M. Buchek
--
booch@mo.net
Technical Details
Message-ID: <3298D616.747F8616@mo.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <199611222247.OAA02902@arcs88.svd.avanticorp.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,1a44262b230b73c3
X-Google-Attributes: gid113d02,public
From: "Craig M. Buchek" <booch@mo.net>
Subject: Re: gcc 2.7.2 bug on hp machine
Date: 1996/11/24
Message-ID: <3298D616.747F8616@mo.net>
X-Deja-AN: 198494056
sender: bug-gcc-request@prep.ai.mit.edu
references: <199611222247.OAA02902@arcs88.svd.avanticorp.com>
content-type: text/plain; charset=us-ascii
organization: -=MO.NET=- MVP-Net, Inc's Missouri Operations
x-gateway: relay3.UU.NET from bug-gcc to gnu.gcc.bug; Sun, 24 Nov 1996 18:13:11 EST
mime-version: 1.0
newsgroups: gnu.gcc.bug
x-mailer: Mozilla 3.0 (X11; I; Linux 2.0.25 i586)