ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Воскресенье
7 июля
204012 Топик полностью
Vladimir Ljaschko (29.07.2010 16:35, просмотров: 179) ответил Dir на Что же они там наворотили такое, чтобы превратить программирование в ад? Ж8( О MISRA не знаю практически ничего, поэтому огромное спасибо Вам и Владимиру за своевременное предупреждение.
А попробуйте откомпилировать свой проект в ИАРе с включенной опцией. Я вот только что включил (частично, где нет шансов - даже не дергаюсь) - 3096 ошибок. Примеры внутри, некоторые очевидные. Error[Pm121]: precautions shall be taken in order to prevent the contents of a header file being included twice (MISRA C 2004 rule 19.15) D:\Work\Type Kplus\xDG2\g_uni_def.h 1 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\k_def.h 29 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\k_def.h 43 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\_PCB\k_ports.h 29 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 30 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 31 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 32 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 33 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\xDG2\g__pins_verb.h 3 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\xDG2\g__pins_verb.h 68 Error[Pm121]: precautions shall be taken in order to prevent the contents of a header file being included twice (MISRA C 2004 rule 19.15) D:\Work\Type Kplus\xDG2\g__pins_verb.h 1 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 36 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 37 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 38 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 39 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 40 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\_PCB\k_ports.h 43 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 44 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 45 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 46 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\xDG2\g__pins_verb.h 3 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\xDG2\g__pins_verb.h 68 Error[Pm121]: precautions shall be taken in order to prevent the contents of a header file being included twice (MISRA C 2004 rule 19.15) D:\Work\Type Kplus\xDG2\g__pins_verb.h 1 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 50 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 51 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 52 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 53 Error[Pm081]: #undef should not be used (MISRA C 2004 rule 19.6) D:\Work\Type Kplus\_PCB\k_ports.h 54 Error[Pm116]: source code shall only use /* ... */ style comments (MISRA C 2004 rule 2.2) D:\Work\Type Kplus\_PCB\k_ports.h 56 Error[Pm123]: there shall be no definition of objects or functions in a header file (MISRA C 2004 rule 8.5) D:\Work\Type Kplus\_PCB\k_ports.h 57 Error[Pm080]: macros shall not be #define'd and #undef'd within a block (MISRA C 2004 rule 19.5) D:\Work\Type Kplus\_PCB\k_ports.h 59 Error[Pm154]: in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) D:\Work\Type Kplus\_PCB\k_ports.h 59 Error[Pm080]: macros shall not be #define'd and #undef'd within a block (MISRA C 2004 rule 19.5) D:\Work\Type Kplus\_PCB\k_ports.h 60 Error[Pm080]: macros shall not be #define'd and #undef'd within a block (MISRA C 2004 rule 19.5) D:\Work\Type Kplus\_PCB\k_ports.h 61 Error[Pm080]: macros shall not be #define'd and #undef'd within a block (MISRA C 2004 rule 19.5) D:\Work\Type Kplus\_PCB\k_ports.h 62 Error[Pm080]: macros shall not be #define'd and #undef'd within a block (MISRA C 2004 rule 19.5) D:\Work\Type Kplus\_PCB\k_ports.h 63