[Mpi-forum] Preprocessor Constants

N.M. Maclaren nmm1 at cam.ac.uk
Sun Nov 21 03:54:36 CST 2010

On Nov 21 2010, Hal Finkel wrote:
>> >> With one reading of the C standard, that breaks conformance; with 
>> >> another, it is recommended practice.
>> >
>> >I'm not sure what you mean by "breaks conformance." ...
>> It's all about the interpretation of the word "reserved" - reserved for 
>> use by whom? Future standards? Implementors (which means of the 
>> compiler)? Or compiler extensions (which is what MPI is)?
>The current C standard (I've copied from WG14/N1256 which is C99 +
>TC[1-3]) section on "Predefined macro names" (6.10.8) states, "Any other
>predefined macro names shall begin with a leading underscore followed by
>an uppercase letter or a second underscore." Although not specifically
>qualified, the rest of the section is discussing macros "defined by the

I am not denying it.  However, I could point you to other sections that
have different implications.  I spent 15 years associated with WG14 and
I can assure you that there are lots of places where apparently primary
wording is overridden by apparently secondary (and sometimes in cases
where you replace 'apparently' by 'formally').

WG14 regards any identifiers beginning with an underscore and either an
underscore or a capital letter as being available for its use, so using
any that it might want for a future standard is a Bad Idea.  Not doing
so doesn't save you, as it does reserve other identifiers, too.  So care
is needed.

I don't see much risk with _MPI, but would warn strongly against _MP,
to give one example.

Nick Maclaren.

More information about the mpi-forum mailing list