Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-19393

qmake silently stops parsing .cpp files with consecutive string literals with no whitespace, fails to generate dependencies on .moc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 4.7.0
    • Build tools: qmake
    • None

    Description

      Tested with Qt 4.7.0.

      Source code with consecutive string literals with no whitespace between them break the moc parsing. For example,

      "hello"" world"

      (which is permitted by the compiler and is the same as "hello world").

      Full steps to reproduce:

      1. Firstly, the "control": create a file named frobnitzquuxer.cpp with the following content:
           #include <QObject>
           #include <stdio.h>
        
           class FrobnitzQuuxer : public QObject
           { Q_OBJECT };
        
           int main(int, char**)
           {
              printf("Hello world\n");
           }
        
           #include "frobnitzquuxer.moc"
           
      2. Run qmake -project && qmake && make && make clean
      3. Observe that it built fine
      4. Now, to demonstrate the breakage: modify the file to the following content: (the only difference is in the `printf' line)
           #include <QObject>
           #include <stdio.h>
        
           class FrobnitzQuuxer : public QObject
           { Q_OBJECT };
        
           int main(int, char**)
           {
              printf("Hello ""world\n");
           }
        
           #include "frobnitzquuxer.moc"
           
      5. Run qmake -project && qmake && make
      6. Observe that compilation breaks: frobnitzquuxer.cpp:12:30: error: frobnitzquuxer.moc: No such file or directory

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Eddy Edward Welbourne
              rmcgover Rohan McGovern (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes