08-03-2018, 03:06 PM
Why is
#include "c:\headers\measurement_regs.h "
non compliant to rule 20.2 due to \ in the path?
#include "c:\headers\measurement_regs.h "
non compliant to rule 20.2 due to \ in the path?
<t></t>
Welcome to the new MISRA discussion forum, if you were previously a member of our forums you may need to reset your password.
Rule 20.2
|
08-03-2018, 03:06 PM
Why is
#include "c:\headers\measurement_regs.h " non compliant to rule 20.2 due to \ in the path?
<t></t>
09-03-2018, 08:40 AM
It is undefined in the C Standard (Annex J.2) hence the MISRA rule:
Quote:The behavior is undefined in the following circumstances: Your example is even worse because you use a hard-coded drive letter. Either use your compiler´s include path and change to or at least use relative paths with '/', e.g.
<t></t>
16-04-2018, 09:27 AM
The "\" is not permitted for the reasons mentioned by dg1980. A deviation is necessary, which will require you to confirm that "\" behaves as required on your system. Some implementations will accept the use of "/" instead of "\".
Posted by and on behalf of the MISRA C Working Group
|
« Next Oldest | Next Newest »
|