Article View: comp.std.c
Article #6279Re: Naming
From: Karl Heuer
Date: Mon, 05 Mar 1990 23:33
Date: Mon, 05 Mar 1990 23:33
19 lines
1583 bytes
1583 bytes
In article <5056@scolex.sco.COM> seanf@sco.COM (Sean Fagan) writes: >In article <16064@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >>[In an example `#define malloc(n) ...'] >>The #define itself is legal (provided you first #undef any old one), but... > >Is it? I was under the impression that the name 'malloc' was reserved >completely. I interpret this as having been legalized by the same decision that permitted "#define char ..." (which had ambiguous legality in an earlier Draft). The relevant section seems to be 2.1.1.2: preprocessing is done in translation phase 4; pp-tokens are converted into tokens and analyzed in phase 7. As I noted before, you may be breaking other rules by doing this (see my earlier article in this thread), but it should make it past the preprocessor. For example, it should be legal to have this #define as the last line in a translation unit. (Pretty useless, too.) Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint
Technical Details
Message-ID:
<16094@haddock.ima.isc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karlReferences:
<16021@haddock.ima.isc.com> <MCDANIEL.90Feb27103334@amara.amara.uucp> <5016@scolex.sco.COM> <16064@haddock.ima.isc.com> <5056@scolex.sco.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: Naming Message-ID: <16094@haddock.ima.isc.com> Date: 5 Mar 90 23:33:34 GMT References: <16021@haddock.ima.isc.com> <MCDANIEL.90Feb27103334@amara.amara.uucp> <5016@scolex.sco.COM> <16064@haddock.ima.isc.com> <5056@scolex.sco.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 19