[Qt-interest] What's wrong with this debug Macro

Thiago Macieira thiago.macieira at trolltech.com
Thu Jun 11 14:16:13 CEST 2009


Rohan McGovern wrote:
>On Thursday 11 June 2009, ext Kermit Mei wrote:
>> Hello, community!
>> For convenience, I define a macro to print the debug infomation:
>>
>> #define DWHERE()                                             \
>>   qDebug(”##FILE: %s ##LINE: %d  ##FUNC: %s”,                \
>>          __FILE__, __LINE__, __FUNCTION__);
>>
>> Macro DWHERE() will print the file, line, and function for me,
>> but it can't be compiled, why?
>
>Hi,
>
>If the macro is exactly as you've pasted here, then the problem is
>probably that the quote characters are "smart quotes".  i.e., you
>have used ” and ”.  Only " must be used.

That's also exactly the error message from GCC:

Widget.cpp:27: error: stray ‘\342’ in program
Widget.cpp:27: error: stray ‘\200’ in program
Widget.cpp:27: error: stray ‘\235’ in program

The sequence \342\200\235 is the UTF-8 encoding for U+201D RIGHT DOUBLE 
QUOTATION MARK.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090611/3c005fd9/attachment.bin 


More information about the Qt-interest-old mailing list