On Tue, 8 Mar 2005, Joona I Palaste wrote:
Affan Syed <as***@usc.edu> scribbled the following: I am not able to figure out exactly what this macro is doing. Can one
of the gurus around here decipher this?
#define sei() __asm__ __volatile__ ("sei" ::)
It's a syntax error. :: is an invalid token in C.
Actually, :: /isn't/ a token in C. Therefore, what we really have
here is one : token, immediately followed by another : token. This
would indeed be a syntax error if it weren't "hidden" by the #define.
#define sei() a bunch of nonsense tokens :: ^%! asd6 **(!%
is perfectly valid C code on its own; it only contributes to a syntax
error once you use 'sei()' in an expression seen by the parser.[1]
Potentially more useful to the OP: The line of code you posted is
from a platform-specific implementation library. We don't discuss
individual platforms here; there are other Usenet newsgroups devoted
to them. Rest assured that you will never need to know what "__asm__
__volatile__ ("sei" ::)" means... or if you can't do that, ask the
question again in a group dedicated to your particular computer
architecture, where someone will probably know what "sei" means to
your computer.
-Arthur
[1] - The parser that parses "real" C code, not the parser that's
part of the preprocessor, that is. How does one accurately and
precisely refer to that concept, without resorting to Standardese
like "the seventh phase of translation," or whatever it is?