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.

CCS/TMS320F28379D: Error-Highlight, when using funktion with default parameters

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

Hello everyone,

I just noticed, that when I use functions with default parameters like:

uint16_t* setupNewPacketHeader(uint32_t cmd, uint32_t length = empty, uint32_t state = RCX_S_OK);

The following line compiles correct, but is marked as error by the syntax-highlithing.

someVariable = *(setupNewPacketHeader(10));

Is this a bug or why is it highlighted?
CCS Version 8.3

  • Hello Marcel,
    in 1-st case setupNewPacketHeader() has 2 params,
    in 2-nd only one.
    Any compiler warnings related to your 2-nd example?
  • Hello,

    in 1-st case there are 3 params, 2 of those have a default value (because empty and RCX_S_OK are defines for 0)
    now I can call this function by giving 1, 2 or 3 parameters (c++ default values will fill the missing ones)
    (see en.cppreference.com/.../default_arguments)
    1) setupNewPacketHeader(10), same as setupNewPacketHeader(10, 0, 0)
    2) setupNewPacketHeader(10, 50), same as setupNewPacketHeader(10, 50, 0)
    3) setupNewPacketHeader(10,50,100)

    The compiler is perfectly fine if I only give 1 or 2 parameters when calling the function.
    But the syntax-highlighting thinks this function with only 1 parameter doesn't exist.
  • Yes,
    3 not 2, typing error.
    Looks like the syntax highlighter syntax rules are not derived from the compiler and C/C++ standard used within a project.
    Probably Eclipse forum is better place to find how syntax highlighter works.
  • Marcel Kummer said:
    The following line compiles correct, but is marked as error by the syntax-highlithing.

    If the compiler is not reporting an error but syntax errors are reported in the editor, then it may be coming from the Eclipse code analysis tools. Please take a look at the Code Analysis and Indexer sections of this article for more details and steps to get rid of these types of errors.