Volatile is Necessary

Karl Heuer karl at haddock.ISC.COM
Thu Apr 7 07:58:28 AEST 1988


In article <-63852956 at sneaky> gordon at sneaky.UUCP writes:
># define setjmp(env) (_builtin_setjmp(env) + 0)
>where the +0 ensures that &setjmp draws an error message

It doesn't work that way.  "&setjmp" (more generally, any use of a function-
-like macro without a left parenthesis) will not be recognized as a macro and
hence no substitution will take place.  (This feature allows you to take the
address of putchar, for example, even if it's implemented as a macro.)  So you
might as well use "#define setjmp(env) __builtin_setjmp(env)" and let the
linker complain about the unresolved symbol "setjmp".

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list