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

Clang code model: include paths in non qmake-based plain C projects broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 3.1.2
    • Qt Creator 3.1.0-beta
    • C/C++/Obj-C++ Support
    • None
    • MinGW

    Description

      Since the following commit:

      commit 31d051a52a884cd4c56288bdc776945698f7357c
      Author: Erik Verbruggen <erik.verbruggen@digia.com>
      Date:   Tue Jan 21 14:57:00 2014 +0100
      
          Clang: tune include paths used by clang
      
          Do not search the standard system directories for include files, but do
          search compiler builtin include directories. To make sure that the
          include files for intrinsics are the ones clang can parse, put that
          path first on the command-line.
      
          Change-Id: I2ada992b58203d1c3dbd55851c5f195c12572943
          Reviewed-by: Eike Ziller <eike.ziller@digia.com>
      

      ...I get the following error message when opening a simple Hello World C project (generic or cmake based):

      implicitly declaring C library function 'printf' with type 'int (const char *, ...)'
      please include the header <stdio.h> or explicitly provide a declaration for 'printf'
      

      Hitting "F2" while the cursor is over "printf" brings me to "stdio.h". When I comment out "#include <stdio.h>", the error message disappears, but "F2" stops working.

      update:

      It seems that this error only occurs when the source file is opened for the first time. After the source file is closed and opened again, the error is gone.

      Attachments

        Issue Links

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

          Activity

            People

              erikv Erik Verbruggen
              eszlari Peter Eszlari
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes