Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Multi-line #defines Date: Fri, 18 Sep 2015 08:39:53 -0700 Organization: None to speak of Lines: 25 Message-ID: References: <93f94067-33d7-42aa-a4dd-bde1e2fe9cd9@googlegroups.com> <2c9c0cc4-4026-4672-b648-1ef2f36ec499@googlegroups.com> <31993891-4970-43d5-9651-e4be76e7bee8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="4072"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8dXJdq8iusX88Cky2WDH6" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Q5SrKf/cn2uiXm87uX9aMr9Q3GI= sha1:jRwkFYLwiovvmApphOjMtxsJDhI= Xref: csiph.com comp.lang.c:70890 mark.bluemel@gmail.com writes: [...] > No - you are looking for a syntax in cpp, which is only loosely > related to C syntax, for this. As the C preprocessor is line-based > (where '\' simply allows line continuation) I doubt you are likely to > find one. Correct, but I wouldn't quite put it that way. The syntax of the C preprocessor is intimately related to C syntax. In fact, it's part of it. It's a part that's quite different from the rest of C's syntax (for example it's line-oriented vs. token-oriented), and it's described in its own subsection of the standard, but it's still part of C. A macro definition must be on one logical source line (N1570 6.10p2). The only way to form a logical source line from multiple physical source lines is by using the \ continuation character (5.1.1.2, translation phase 2, line splicing). -- 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"