Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17595

Clang: problems with stdint.h in C mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • Qt Creator 4.3.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • OS X 10.12.2 Sierra, default clang compiler

    Description

      This is a followup on QTCREATORBUG-15303

      I am on OS X 10.12.2 Sierra. I am not sure if any of the following applies to other platforms.

      In 4.3.0-beta-1, .c files are now correctly recognized as C code (not C++ anymore). However, this works only if the C compiler is set to GCC (as in the screenshot). If I set it to Clang, then .c files are still parsed as C++.

      Types from <stdint.h> do not work in C mode. E.g., uint8_t is not recognized as a valid type (screenshot).

      In C++ mode, there is no problem with <stdint.h> (or with <cstdint>).

      <stdint.h> on my system is very similar to this: http://clang.llvm.org/doxygen/stdint_8h_source.html There seem to be separate and different definitions for C and C++. I am not sure where the C ones are as they use #include_next.

      A generic project that demonstrates the problem is attached.

      Attachments

        1. Project.zip
          3 kB
          Szabolcs Horvát
        2. Screenshot 2017-01-16 11.52.18.png
          36 kB
          Szabolcs Horvát
        3. Screenshot 2017-01-16 12.24.51.png
          61 kB
          Szabolcs Horvát

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              szhorvat Szabolcs Horvát
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes