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/TCI6636K2H: Compiler C6000_8.1.3 missing _GNUC_ symbols

Part Number: TCI6636K2H

Tool/software: TI C/C++ Compiler

Hi

I previously used compiler version 7.4.17

It had the following GNUC symbols

_GNUC_ = 3

_GNUC_MINOR = 0

If i change the compiler version to 8.1.3 I have the following:

_GNUC_GNU_INLINE = 1

_GNUC_MINOR = 3

_GNUC_PATCHLEVEL = 0

A lot of code is dependent on preprocessor _GNUC_

What can I do to get it (besides defining it myself)

If only defining it by myself is an option than : What is the GNUC version? for this compiler

Also i noticed that a few of my projects don't show all of the built in symbols (even though the show built in symbols is turned on) however the symbols are defined. I checked in the code. Any idea why?

  • You'll need to define __GNUC__ yourself if you need to use it. Our conclusion is that common practice uses those macros to mean "this really is GCC, or is so perfect of a clone it doesn't matter." This was not true for the TI compiler, so we stopped defining __GNUC__. We shouldn't be defining __GNUC_MINOR__ or __GNUC_PATCHLEVEL__ either, that's a bug.

    If you compile a blank C file with the option --preproc_macros (-ppm), you'll get a .pp file which shows all of the predefined macros. On of particular interest is __VERSION__; for C6000 8.1.3, it says:
    #define __VERSION__ "EDG gcc 4.3 mode"
    For C6000 7.1.14, it was:
    #define __VERSION__ "EDG gcc 3.0 mode"

    Note that the TI compiler does not precisely emulate gcc 4.3, so you can't count on being 100% portable between GCC 4.3 and the TI compiler.

    I'm sorry, I'm not sure what you mean by "show all of the built-in symbols." Is this something in the Code Composer code view window?
  • Shiran Ben Israel said:
    Also i noticed that a few of my projects don't show all of the built in symbols (even though the show built in symbols is turned on) however the symbols are defined. I checked in the code. Any idea why?

    Which version of CCS are you using, and are you running CCS under Windows or Linux?

    I have seen that problem before, whereby the CCS indexer doesn't pick up the compiler pre-defined symbols.

    The last time I checked with CCS running under Windows saw the problem in CCS 6.2.0.00050, but not in CCS 7.1.0.00016 - see https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/589392

  • Archaeologist said:
    Is this something in the Code Composer code view window?

    I assume it is the following properties, part of the advanced settings:

    Where the above list of pre-defined symbols is generated by CCS executing a command to get the compiler to report the built-in symbols, and the list of built-in symbols is then used by the CCS indexer.

  • Hmm.. Okay, can you give me an example of a symbol that should appear there but doesn't?
  • bellow is a snapshot from two projects which are very much alike and yet the pre-processor values that are shown in one, are missing from another

    i think it is more of a visual issue than a real problem, since the pre-processors that are shown in the full project are defined in the missing project as well, they are just not shown

    this is an example of a project that looks like it is missing symbols

    With:

  • This thread is moving to the Code Composer Studio forum for further discussion.

    Thanks and regards,

    -George