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.

MISRA: 1.)exclamation marks where isn't code 2.)HALCodeGen source code isn't conform

Other Parts Discussed in Thread: HALCOGEN

Hello,

I work with Hercules Safety MCU Development Kit TMS570 MCU and use CCS 5.3.0.00083 on system windows 7 servicepack1.

1.)--------------------------------------------------------------------------------------------------------------------------------------------------------

Today I’ve enabled Misra Check (only 10.1) and got exclamation marks at C-Files at line numbers where is no code (line number: 155,185,194,209,210,232,233,253,283). The problem isn’t at the C-File but at string.h (see warnings at console). 

C:/ti/ccsv5/tools/compiler/arm_5.0.1/include/string.h", line 155: warning #1393-D: (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness

"C:/ti/ccsv5/tools/compiler/arm_5.0.1/include/string.h", line 185: warning #1393-D: (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness

.

.

How I prevent the exclamation marks at the C-File?

2.)--------------------------------------------------------------------------------------------------------------------------------------------------------

Further there are a lot of exclamation marks (and corresponding warnings at console) at source files generated by the HALCodegen e.G. at adc.c at line numer 50.

"../source/adc.c", line 50: warning #1393-D: (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness

What can I do to force the HALCodeGen to generate Misra conform source code?

Regards Volker

  • Volker Kistner38 said:

    1.)--------------------------------------------------------------------------------------------------------------------------------------------------------

    Today I’ve enabled Misra Check (only 10.1) and got exclamation marks at C-Files at line numbers where is no code (line number: 155,185,194,209,210,232,233,253,283). The problem isn’t at the C-File but at string.h (see warnings at console). 

    I can't seem to reproduce this. I can see some MISRA 10.1 errors coming from the source files and they are correctly pointing to the expected line numbers. I don't see any for string.h. I tried with both CCS 5.5 and 6.0.1. I see that you are using CCS 5.3 and compiler version 5.0.1, both of which are pretty old. Could you give a newer version of CCS a try? http://processors.wiki.ti.com/index.php/Download_CCS

    Volker Kistner38 said:

    2.)--------------------------------------------------------------------------------------------------------------------------------------------------------

    Further there are a lot of exclamation marks (and corresponding warnings at console) at source files generated by the HALCodegen e.G. at adc.c at line numer 50.

    "../source/adc.c", line 50: warning #1393-D: (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness

    What can I do to force the HALCodeGen to generate Misra conform source code?

    This question mighe be best answered by the folks in the Hercules forum (so please feel free to post again there if you wish) but I can say that there have been many fixes/improvements to the compiler tools since 5.0.1 in terms of MISRA checking. Looking at some other posts in the Hercules forum it appears that there have some improvements in HalCoGen as well in terms of MISRA compliance. I would suggest updating both your version of CCS and HalCoGen and let us know of any issues/concerns that remain.

  • Hi, thanks for your answer.

    I’ve updated the arm compiler to version 5.0.10 and the HALCoGen version was already 4.01.00, but the problems still exist.

    I will try to update CCS to version 6 and come back again.

    Regards Volker

  • Hi,

    By now I use CCS 5.5, arm compiler 5.1.8, HALCogen 4.01.00 but the problems still exist.

    HALCoGen still generates not MISRA conform C-code. (e.g. can.c line 483)

    There are still exclamation marks in c-files but the problem is at string.h.

    What can I do?

    Regards Volker

  • Volker Kistner38 said:

    HALCoGen still generates not MISRA conform C-code. (e.g. can.c line 483)

    For issue 1, please post this to the Hercule forum as they are the team that creates and maintains HALCoGen.

    Volker Kistner38 said:

    There are still exclamation marks in c-files but the problem is at string.h.

    For issue 2, could you please zip up and attach your project here so we can reproduce the issue? If you do not wish to post the project here on the forum, you can also send it to me vi private conversation.

  • Hi, I wrote a small test project where you can see the same problems.

    1145.TestProjekt.zip

    Please see at c-file sys_main.c line 157. There is no source code but an exclamation mark, the corresponding warning you will find at console window.

    "C:/tiCCS5_5/ccsv5/tools/compiler/arm_5.1.8/include/string.h", line 157: warning #1393-D: (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness

    Regards Volker

  • Volker Kistner38 said:

    Please see at c-file sys_main.c line 157. There is no source code but an exclamation mark, the corresponding warning you will find at console window.

    I see this with CCS 5.5 but not with CCS 6.0.1. Please see the attached screenshots for both versions (first one is for CCS 5.5 and second one is for CCS 6.0.1). As you can see in CCS 6.0.1, sys_main.c is not listed in the Problems view and clicking on the warning line in the build console opens up string.h and takes you to the correct line in string.h rather than that line number in sys_main.c (which is what happens in CCS 5.5). So this issue looks to be fixed in 6.0.1.