C programming hint

Niket K. Patwardhan lcc.niket at UCLA-LOCUS.ARPA
Fri Jul 19 21:12:09 AEST 1985


I scanned the C standards draft a while ago and remembered there was something
about builtins. Well, I went back and checked, and found there isn't any
declaration as such, but it does say (Page 68, Introduction of Library section)
that

"One implication of this restriction <....external identifiers starting with
_ are reserved ....> is that implementations may provide special semantics
for names starting with underscore. For example, _builtin_abs could be used
to <.....define an inline abs>."

It also warns that any function defined in a header file could be a macro,
and that if you wanted your own function you should use the #undef directive
to nullify any such macro definition before using your function. Thus an
implementor says

#define abs _builtin_abs

in his header file, and users would get the builtin abs normally. If they wanted
to use their own abs, they would #undef abs before using it.



More information about the Comp.lang.c mailing list