This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler warning in CCS



Hi,

In CCS, Compiler v5.1.x(arm_5.1.1)  throws up a warning when a .(dot) operator is used in a macro. This was not showing up in compiler v5.0.x..(arm_5.0.6)

Warning is of following type, for the line in #defiine Fapi_GlobalInit.m_poFlashControlRegisters (FLASH_CONTROL_REGISTER)

#1921-D white space is required between the macro name "Fapi_GlobalInit" and its replacement text Compatibility.h /LS3137/flash line 49 C/C++ Problem"

Regards,

Vishwanath Reddy. 

  • Please post a source file, preprocessed like this, which we can build to see this problem ourselves.  Please include the build options you use to build it.

    Thanks and regards,

    -George

  • Hi Geroge,

    Below are build options and attached is the required file.6281.1411.Fapi_UserDefinedFunctions.pp.c

    Remove the .c extension.

    Regards,

    Vishwanath Reddy.

     

  • I apologize.  I cannot reproduce this problem by building a preprocesed file.  Your problem occurs during preprocessing.  So I should have realized that asking you to send a preprocessed file would mask the problem.  

    Please build with --verbose_diagnostics and see what comes out in the Console (not Problems) view.  The problem source line will be echoed, and that might make things more clear.

    If it doesn't, then you probably need to send the whole project so we can reproduce it.

    Thanks and regards,

    -George

  • Hello George,

    the message in console is:

    C:\ti_CCS5v5\Hercules\F021 Flash API\02.00.01\include\Compatibility.h", line 49: warning #1921-D: white space is required between the macro name "Fapi_GlobalInit" and its replacement text

    and line 49 is:

    /* Define to provide backwards compatibility with the old global variable Fapi_GlobalInit.m_poFlashControlRegisters */
    #define Fapi_GlobalInit.m_poFlashControlRegisters (FLASH_CONTROL_REGISTER)

    and with verbose_diagnostics I get:

    "C:\ti_CCS5v5\Hercules\F021 Flash API\02.00.01\include\Compatibility.h", line 49: warning #1921-D: 
              white space is required between the macro name "Fapi_GlobalInit" and
              its replacement text
      #define Fapi_GlobalInit.m_poFlashControlRegisters (FLASH_CONTROL_REGISTER)

    Thomas

  • You can't create a preprocessor symbol with a period in the name.  Only letters, numbers, and underscore are allowed.  Thus, you are defining the preprocessor symbol named "Fapi_GlobalInit" with the value ".m_poFlashControlRegisters (FLASH_CONTROL_REGISTER)", which is surely not what you want.  Change the code so that it looks something like this:

    #if NEW_WAY
    #define MY_FLASH_CONTROL_REGISTER FLASH_CONTROL_REGISTER
    #else
    #define MY_FLASH_CONTROL_REGISTER Fapi_GlobalInit.m_poFlashControlRegisters
    #endif
  • Hi Archaeologist,

    you know that this #defines are exactly those from the TI Flash library headers? :-)
    Will it be fixed with the next revision?

    Greetings,
    Michael

  • No, I was not aware of that.  The compiler team does not maintain those header files.  I'll have to find out who to forward this issue to.

  • Having the same issue described in this thread, since updating and trying to work with FEE. Getting 27 warnings from various TI header files...

  • Which specific header files do the warnings appear in?  They may have different maintainers.

  • In the latest version of my project, using the most current CCS and ARM compiler tool, the warning list comes down to these:

    16 times:

    Description Resource Path Location Type
    #1921-D white space is required between the macro name "Fapi_GlobalInit" and its replacement text Device_TMS570LS04.c ‪/DCAN/source‬ line 49, external location: C:\ti\Hercules\F021 Flash API\02.00.01\include\Compatibility.h C/C++ Problem

    8 times (various locations within hal_stdtypes.h) :

    Description Resource Path Location Type
    #303-D typedef name has already been declared (with same type) hal_stdtypes.h ‪/DCAN/include‬ line 29 C/C++ Problem

    and:

    Description Resource Path Location Type
    #48-D incompatible redefinition of macro "false" (declared at line 77 of "C:\ti\Hercules\F021 Flash API\02.00.01\include\Types.h") sys_main.c ‪/DCAN/source‬ line 26, external location: C:\ti\ccsv5\tools\compiler\arm_5.1.1\include\stdbool.h C/C++ Problem

    Description Resource Path Location Type
    #48-D incompatible redefinition of macro "true" (declared at line 80 of "C:\ti\Hercules\F021 Flash API\02.00.01\include\Types.h") sys_main.c ‪/DCAN/source‬ line 27, external location: C:\ti\ccsv5\tools\compiler\arm_5.1.1\include\stdbool.h C/C++ Problem

    My include list looks like this:

    #include "ti_fee.h"
    #define _BOOLEAN_DECLARED
    #include "system.h"
    #include "sys_core.h"
    #include "can.h"
    #include "sci.h"
    #include "gio.h"

    Thanks,

    Oron