On Mon, Oct 17, 2011 at 10:21 PM, Oleg Goldshmidt <[email protected]> wrote:
> "Nadav Har'El" <[email protected]> writes:
>
>> In any case, because there was always a fear that the compiler might
>> optimize these out, someone invented a new directive, #ident, as in:
>>
>> #ident "$Id$"
>
> This has always been there, but it has never been standard, AFAIK. It
> is not a GCC extension, either. Most preprocessors don't barf on
> directives they do not understand, but they may simply ignore #ident
> which will lead to the same behaviour that I do not want.

Just to make things more interesting, it looks like MS Visual Studio
2010 ignores #ident, warns about it, and suggests

#pragma comment(exestr,"$Id$")

instead, which works. It also emits nothing for a static const char
foo[] = "$Id$" in either Release or Debug mode.

Luckily, it seems to provide __pragma() which should be the same as
_Pragma and can be hidden in preprocessor macros.

-- 
Oleg Goldshmidt | [email protected]

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to