Preprocessor behavior

Munagala Ramanath Munagala.Ramanath@postx.com
Mon Oct 16 13:26:00 GMT 2000


Hi,

Using the macro:
#define T( X ) L ## X
to create a wide string fails with the predefined __FILE__ symbol
(i.e. T(__FILE__)) with gcc-2.95.2 on Sparc/Solaris7 because it
apparently catenates the body to get L__FILE__ before rescanning.

MSVC yields the expected L"<filename>".

Is this a bug in gcc or is it required by the standard ? Does anybody
know any way to generate wide string literals out of __FILE__ ? Thanks.

Ram



More information about the Gcc mailing list