[5621] in Athena Bugs

home help back first fref pref prev next nref lref last post

saber 2.1.2 on vax: macro expansion in ansi mode

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Fri Jul 27 19:21:02 1990

Date: Fri, 27 Jul 90 19:20:47 -0400
From: Ken Raeburn <Raeburn@MIT.EDU>
To: bugs@MIT.EDU


1 -> struct x { int (*foo)(); };
2 -> struct x x1;
3 -> #define foo(x) (*(x)->foo)()
4 -> int z () {
5 +>         return foo (&x1);
6 +> }
7 -> int yyy () { return 37; }
8 -> x1.foo = yyy;
Error #238:  The '(' is missing after macro 'foo'.
9 -> x1.foo ^C= yyy;
9 -> printopt ansi
ansi                 TRUE
boolean - perform preprocessing and prototype conversion according to ANSI

According to ANSI, "foo" is a macro invocation only if it is followed
by a "(".

home help back first fref pref prev next nref lref last post