This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Is it possible to generate unique goto labels with preprocessor?



I'm making a hack which require a macro to generate goto labels (I can of 
course provide the label as an argument to the macro, but that significantly 
reduces the maintainability of the resulting code).

My idea was to do like this:

label ## __LINE__:

but then I just get

label__LINE__:

after the preprocessor has done its work, and I would like to have

label897:

if the line number happened to be 897.

Is it possible with this way, or other, to generate unique goto labels with 
the preprocessor?

Please answer to me directly, since I'm currently not on the list.

/Anders Torger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]