Macros: Meaningful or Myth?

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Sep 14 22:47:44 AEST 1989


In article <11580017 at hpisod2.HP.COM> decot at hpisod2.HP.COM (Dave Decot) writes:
>Where in the dpANS is the term "macro" defined?

Constraints on the use of the term appear all over 3.8, but "macro"
itself is a general computing term found in ANSI X3/TR-1-82 (see 1.6).

>I find references to "the setjmp macro", and then find that "whether setjmp
>is a macro or a function is unspecified", and then find out that "errno"
>is to be a "macro" defined in <errno.h>.

"It is unspecified whether errno is a macro or an identifier declared
with external linkage." (4.1.3)

The temporary use of the single word "macro" in part of the description
is for readability (and to remind you that it's not necessarily an
object identifier).  It must be understood in the light of the
additional description that clarifies this.

>I hope this doesn't mean the implementation has to use "#define" to
>do something with errno.

No, but it might, so a strictly conforming program should not for
example presume that errno is the identifier of an object.

>Is it OK for an implementation to provide setjmp only as a real function?

Sure.  That's why it is unspecified whether it is "really" a macro
or a function.



More information about the Comp.std.c mailing list