🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2350

Strange error message from gcc 1.30

#2350
From: David Keppel
Date: Fri, 24 Feb 1989 00:55
69 lines
1721 bytes
The following program causes the cpp error message to have line zero
instead of, say, the line of ``invocation'' of the macro.

MACHINE: VAX 8550, Ultrix 2.3
GCC: 1.30, built using configuration shell script.
Repeat by:


::::::::::::::
main.c
::::::::::::::

#define AMACRO(arg)	foo(arg)


#ifdef LINT
    extern int ZERO;
#else
#   define ZERO 0
#endif

#define STMT(s)		do { s } while (ZERO)

#define BUG(arg) \
			STMT( AMACRO((arg); )
/*                                   ^ this is a bug!
*/


    void
foo (int arg)
{
    ;
}

    int
main (void)
{
    int x;

    foo (x);

    /* Is this it? */
    BUG(x);

    /* Or is this it? */
    BUG(x);
}

::::::::::::::
gcc -g -ansi -v -W -Wimplicit -Wreturn-type -c main.c
::::::::::::::

gcc version 1.30
 /uns/src/GNU/g++/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -T -$ -D__STRICT_ANSI__ main.c /tmp/cc011961.cpp
GNU CPP version 1.30
main.c:0: unterminated macro call
main.c:38: only 0 args to macro `STMT'
*** Error code 1


::::::::::::::
End
::::::::::::::

	;-D on  ( Error messages named after quarks )  Pardo
-- 
		    pardo@cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo
Technical Details
Message-ID: <7373@june.cs.washington.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!uw-june!pardo

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!uw-june!pardo
From: pardo@june.cs.washington.edu (David Keppel)
Newsgroups: gnu.gcc.bug
Subject: Strange error message from gcc 1.30
Summary: Maybe not a bug.
Message-ID: <7373@june.cs.washington.edu>
Date: 24 Feb 89 00:55:10 GMT
Reply-To: pardo@cs.washington.edu (David Keppel)
Distribution: gnu
Organization: U of Washington, Computer Science, Seattle
Lines: 69