On Mon, Nov 21, 2011 at 12:02:15AM +0100, Lars Gullik Bjønnes wrote: > Systemcall.cpp:337:65: error: inconsistent user-defined literal suffixes > ‘__FILE__’ and ‘QTOSTRING’ in string literal > Systemcall.cpp:337:65: error: unable to find user-defined string literal > operator ‘operator"" __FILE__’ > > This seems to be our own problem. > Unless it is something we inherit from Qt. > Ahh nice... it is Qt.
Indeed. The error istriggered by #define QTOSTRING_HELPER(s) #s #define QTOSTRING(s) QTOSTRING_HELPER(s) #define QLOCATION "\0"__FILE__":"QTOSTRING(__LINE__) > And the wonderfull non-c++ parts of Qt. The preprocessor is part of C++ (both 98/03 and 11), how that can be dubbed "non-c++" is beyond me. The first two lines represent the canonical way to stringify expanded values using the C++ preprocessor. The third line is valid C++ in the 1998 and 2003 versions of the Standard. Unfortunately, the 2011 version of the Standard introduces "user defined literals" which are - as shown by this example - source incompatible, i.e. previously valid code is now invalid. Blaming library code that has been around for a quite a while for not anticipating such changes seems odd, especially if previous versions of gcc happily accepted that code in "C++0x" mode. Andre'