🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2312

macro bug in gcc cpp 1.31

#2312
From: Frans Meulenbroeks
Date: Wed, 15 Feb 1989 09:41
54 lines
2063 bytes
Hi!

I encountered the following bug in gcc/cpp 1.31:
On compiling a macro which has a function call as one of its arguments,
cpp complains about too many arguments.
cc on sun does not have this problem.

Offending file:
contrib/windwomgrs/rtl/manage.c from the out of the box X11R3
distribution. I do not include the file since it is quite big.
If it is needed to repeat the bug, please drop me a note.

script:

1:uims> gcc -v -I/usr/cstu40/uims/X11R3  -O  -sun3 -c  manage.c
gcc version 1.31
 /usr/cstu20/gadgets/lib/gcc-cpp -v -I/usr/cstu40/uims/X11R3 -undef
-D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__OPTIMIZE__
-D__HAVE_68881__ -Dmc68020 manage.c /tmp/cca23501.cpp
GNU CPP version 1.31
manage.c:3645: too many (5) args to macro `window_excursion'
1:uims> cc  -O -I/usr/cstu40/uims/X11R3  -O  -sun3 -c  manage.c
1:uims> 

Note: the command line is artificially broken since it will not fit on
one line.

The offending code:
   height_excursion( uwinp->winp,
       width_excursion( uwinp->winp,
           window_excursion( uwinp->winp, REQUIRE_MANUAL_CLOSE, TRUE,
                            Manage_Finish( result ) ) ) );


The offending macro:
#define window_excursion(win,opt,val,code) \
{ \
    bool temp_val; \
    temp_val = Tilwin_Get_Window_Option(win,opt); \
    Tilwin_Set_Window_Option(win,opt,val); \
    code; \
    Tilwin_Set_Window_Option(win,opt,temp_val); \
}

If you need additional info, please let me know.

Keep up the good work!



-- 
Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
	Centre for Software Technology
	( or try: ...!mcvax!philmds!prle!cst!meulenbr)
Technical Details
Message-ID: <337@cstw01.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!ames!xanth!uunet!mcvax!hp4nl!philmds!prle!cstw01!meulenbr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!ames!xanth!uunet!mcvax!hp4nl!philmds!prle!cstw01!meulenbr
From: meulenbr@cstw01.UUCP (Frans Meulenbroeks)
Newsgroups: gnu.gcc.bug
Subject: macro bug in gcc cpp 1.31
Message-ID: <337@cstw01.UUCP>
Date: 15 Feb 89 09:41:16 GMT
Reply-To: meulenbr@cst.UUCP ()
Organization: Centre for Software Technology, Philips Eindhoven
Lines: 54