Re: Inline assembly without inputs considered const/pure?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since you are already using cc extensions like ({ ... }), you may prefer
to use __COUNTER__ rather than __LINE__.


Consider preprocessor input like
    #define X __LINE__
    #define Y  X,X,X,X

    Y;

    #undef X
    #define X __COUNTER__

    Y;

The first definition of X gives
    4,4,4,4; // depending on the line that first Y; is on
and the second one gives
    0,1,2,3;


This can be particularly important if mrs() is used multiple times in another
macro, since when the macro is expanded it is all expanded with the same
value for __LINE__.

Jeff



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux