Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: 'Amalgamated' source code Date: Tue, 03 Jan 2017 16:26:34 -0800 Organization: None to speak of Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="167f7d05f22907ea8e3985ed50c4ed73"; logging-data="9414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xT63P2oywfTv6bX+baviu" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:FB2cGPDliWLhKqjal4S31y0tizE= sha1:par4ZhEMYF1OHogq0ZqktfJsQeI= Xref: csiph.com comp.lang.c:101063 Thiago Adams writes: > On Tuesday, January 3, 2017 at 7:36:53 PM UTC-2, Bart wrote: [...] >> (But I've just seen one detail I hadn't allowed for, in gcc.c (from >> http://people.csail.mit.edu/smcc/projects/single-file-programs/). On >> line 733881 in a macro call: >> >> DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_0) >> >> The token '1_0' appears. It starts as a number but presumably must be >> treated as alphanumeric. 1_0 is a pp-number, which will result in a syntax error if it survives preprocessing (assuming you're trying to implement ISO C requirements). > This did not work for me as well. > > #define M(1_0) > > M(1) What did you expect that to do? If the macro name in a #define is followed by a '(' with no whitespace, the '( is followed by a list of macro parameter names, which must be identifiers. 1_0 is not valid in that context. "gcc -E" complains: error: "1_0" may not appear in macro parameter list -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"