🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #580

curiosity in gcc 1.36; ANSI behavior?

#580
From: david%ics.com
Date: Wed, 06 Dec 1989 14:38
31 lines
1176 bytes
This is the behavior with gcc 1.36 (no fixes) on a Sun 4/60:


#include <stdio.h>

#define A(x)
#define B(x,y)
#define C(x,y)

main()
{
A();		/* flagged by gcc but not cc */
B();            /* flagged by gcc and cc */
C(,);           /* not flagged by gcc or cc */
}

gcc testing.c
testing.c:9: no args to macro `A'
testing.c:10: no args to macro `B'

cc testing.c
testing.c: 10: B: argument mismatch

I can see that C is OK and I can see that B could be considered not OK.
But the different handling of A is a problem in that there does not seem
to be a general way to indicate 0 arguments to that macro.

gcc -traditional testing.c
testing.c:10: no args to macro `B'

So is this behavior really ANSI, or is there something else going on?
Technical Details
Message-ID: <8912061438.AA00359@melvin.ics.com.ics.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!BU.EDU!david%ics.com

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!BU.EDU!david%ics.com
From: david%ics.com@BU.EDU
Newsgroups: gnu.utils.bug
Subject: curiosity in gcc 1.36; ANSI behavior?
Message-ID: <8912061438.AA00359@melvin.ics.com.ics.com>
Date: 6 Dec 89 14:38:00 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 31