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

Syntax checker does not understand C99 initializer lists

    XMLWordPrintable

Details

    • c56b999ffff249d4cb7dc7e8026a3297b63ff56d

    Description

      I'm using Creator 2.0 with a C99 program and have the following demo structure:

      typedef struct
      {
       char name[20];
       int ID;
       int age;
       FILE *record;
      }
      Employee;
      
      Employee emp = {.ID=0, .record=NULL};
      

      This is valid C99 code but Creator underlines the initializer line in red with the error 'expected token '} ' got '.'

      The code compiles fine without errors.

      I'm using GCC 4.2 on OS 10.6.3 and have added the QMAKE_CFLAGS += -std=c99 to the .pro file.

      While I appreciate that C++ has priority, C remains a very popular language and Creator is an excellent IDE for C development. This is only the problem I've encountered.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-1902
          # Subject Branch Project Status CR V

          Activity

            People

              erikv Erik Verbruggen
              danny77uk Daniel
              Votes:
              18 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes