🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by david%ics.com Wed, 06 Dec 1989 14:38
curiosity in gcc 1.36; ANSI behavior?
#580
Author: 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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads