Date: Tue, 28 Feb 2006 20:42:05 -0800 From: Tim Kientzle <kientzle@freebsd.org> To: "'freebsd-current@freebsd.org'" <freebsd-current@freebsd.org> Subject: m4 include() broken? Message-ID: <4405261D.2060101@freebsd.org>
next in thread | raw e-mail | index | archive | help
I'm still a little new to M4, so I may have gotten this wrong, but it looks like the BSD M4 implementation bombs on include(): $ echo AAA > input $ m4 define(`SYM',include(`input')) m4: unexpected end of input, unclosed parenthesis: stdin at line 1 I tried this on MacOS 10.4.4 and it reports no errors (GNU M4 1.4.2). On FreeBSD-CURRENT and 5.3, it bombs with the above error. Tracing through main.c, it looks like the scanner is explicitly forbidding include() as an argument to another macro by requiring that any include() close all parens: usr.bin/m4/main.c, around line 380: } else if (t == EOF) { if (sp > -1) { warnx( "unexpected end of input, unclosed parenthesis:"); dump_stack(paren, PARLEV); exit(1); } if (ilevel <= 0) break; /* all done thanks.. */ To verify this, note that the following does not generate an error: $ echo 'AAA)' > input $ m4 define(`SYM',include(`input') SYM() AAA Can anyone who knows M4 better than me confirm that the current handling of include() is wrong? Tim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4405261D.2060101>