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/TMS320F28377S: error: symbol .. redeclared with incompatible type: null

Part Number: TMS320F28377S

Tool/software: TI C/C++ Compiler

Hello,

I have exactly the same problem related in this post:

https://e2e.ti.com/support/development_tools/compiler/f/343/t/325734

I'm using now the CCS 7.4 with the compiler Ti v17.9.0.STS. for the F28377s.

In the above post, the problems seems came from the compiler C6000.

Is correction is planned for compiler C2000?

Thanks

  • The problem is caused by, among other things, using the option --program_level_compile, or -pm for short.  There is no longer any reason to use this option.  You can get the same optimization, and sometimes better optimization, by using the option --opt_level=4.  And you won't see these problems with incompatible types.  In summary, remove -pm and use --opt_level=4.

    Thanks and regards,

    -George

  • Hello
    I did not find where I can disable this option (--pm or --program_level_compile) in CCS project option ..
    Where is it?
  • If you don't use --program_level_compile, then you probably have a completely different problem.  Does this problem occur when you build just one file?  If so, please submit a test case as described in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • Hello

    I don't know if I use nor not this option.

    I don't find where check it! Could you indicate to me where I can check it?

    The error occurs only on the link time if I'am on Optimization Level 4. If I build only the concerned file, no error occurs.

    Then the link you provide me is not usable.

  • A GIR said:
    I don't find where check it! Could you indicate to me where I can check it?

    I presume you build with Code Composer Studio.  To see the build options dialog, right-click the name of your project and select Show Build Settings.  Much more information about CCS project builds can be found in the article Projects and Build Handbook for CCS.  

    A GIR said:
    The error occurs only on the link time if I'am on Optimization Level 4.

    In that case, the only way to reproduce the problem is if you submit the full project.  Please zip it up as described in the article Project Sharing, then attach that zip file to your next post.

    Thanks and regards,

    -George

  • Hello

    I can't transmit all the project!

    Then I extract the part which cause problem, and in this case, problem not occurs...

    I will make some check (multi inclusion etc....)

  • A GIR said:
    I can't transmit all the project!

    Are you willing to send it just to me?

    Thanks and regards,

    -George

  • Yes of course, if I have the guarantee that it will never be broadcast and used by anyone.

    By which way I can transmit it?

  • Hover your mouse over my screen name or avatar.  A box will pop up.  Click on Send a private message.  In the message compose interface which comes up, use the paper clip icon to attach the zip file.

    Thanks and regards,

    -George

  • Thank you for submitting a test case.  I can reproduce the problem.  I filed CODEGEN-4605 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    The workaround is to not use any anonymous structures or unions.  Always name them.  I will privately message you specific details for your source code.

    Further clarification added later ... To avoid the problem, a struct or union must have both a tag and name.  For example ...

    struct STRUCT_TAG {
       int field1;
       int field2;
       /* and so on */
    } STRUCT_NAME;

    Note those syntax tokens in all capital letters.  To avoid the problem, those must be present.

    Thanks and regards,

    -George

  • Hello,

    Thank for your back.

    I already applicate the workaround which consist to always name field.

    But which is strange, it is to test, I remove all file of my project except the faulty file and the main.h/.c..

    I also test this structure with a blank project.

    Both compile and link without problem.

    Then something in my other files make crash the linker...

  • A GIR said:
    Then something in my other files make crash the linker...

    Unfortunately, the only way to know what happened is for you to submit a test case which allows us to reproduce it.  I'd appreciate if you would submit one just like you did before.

    Thanks and regards,

    -George

  • Since it has been a while, I presume you have resolved the problem.  I'd appreciate if you would let us know you resolved it.

    Thanks and regards,

    -George

  • Hello

    I seem I transmitted to you a project like you asked to me but may be it is a mistake from me.


    Then I send it to you by private message

    With this project, the structure type with void name work properly.


    Best Regard
  • A GIR said:
    Then I send it to you by private message

    I received this test case.  Thank you!

    A GIR said:
    With this project, the structure type with void name work properly.

    Unfortunately, I misunderstood you at first.  Now I know what you mean.  You are saying that, in some cases, you use structures that either have no tag, or no name.  In that case, given the reported bug, you would expect the build to fail.  Yet it succeeds.  Why?

    This is a reasonable question. Unfortunately, I don't have an explanation.  At this point, we don't know all the circumstances of the bug.  Sometimes, a structure without a tag or name causes problems, sometimes it doesn't.  It is clear yet other circumstances must be present, and those circumstances are not presently known.  I expect this will all become more clear as the cause of the bug is investigated.

    Thanks and regards,

    -George

  • Ok,

    Thank ,

    Then I'm waiting the bug correction!

    :-)