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

QMakeSourceFileInfo::findDeps doesn't handle UTF-8 BOM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.1
    • 4.8.5, 5.1.1
    • Build tools: qmake
    • None
    • Win7 MSVC2010
    • 96ff51f856c34c7826c13c2d4c376022e6b7d027

    Description

      In source files that start with a UTF-8 BOM, qmake misses header dependencies on the first line because it considers the BOM as non-whitespace and hence sets beginning=0.

      Further, the parsing of quoted strings also has a bug: when the closing '\'' or '"' is detected, x gets incremented, and then the outer for loop increments it again. This results in qmake missing the character immediately following the quoted string as well. That means that, having missed the first #include line because of BOM, we miss subsequent ones as well, until reaching some line that is not #include "..."\n.

      This bug can be observed in the resulting Makefile: example.c gets all headers detected, but example-utf8.c is missing the first three

      release\example.obj: example.c C:\Desktop\example\missing.h \
      C:\Desktop\example\also-missing.h \
      C:\Desktop\example\detected.h

      release\example-utf8.obj: example-utf8.c C:\Desktop\example\detected.h

      Attachments

        1. example.zip
          1 kB
          Kevin Puetz
        For Gerrit Dashboard: QTBUG-34182
        # Subject Branch Project Status CR V

        Activity

          People

            tetsurom MATSUMURA Tetsuro
            puetzk Kevin Puetz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes