Return to Home
  View the contents of your Cart View cart  
  0 item(s) in cart  
  Checkout  

Gimpel Software - Discussion Forum
Discussion Forum
We invite you to use this forum to communicate with other PC-lint and FlexeLint users. You do not need to log in to post a message. WARNING: Your email address will not be encrypted. We recommend that you obfuscate it as protection from web crawlers. To receive technical support directly from Gimpel Software, please follow the guidelines at http://www.gimpel.com/html/support.htm
Gimpel Software - Discussion Forum
Subject From Date & Time
Not properly handling "#if defined"? Michael Metivier November 10, 2012
12:02:57 PM
  Re: Not properly handling "#if defined"? Henrik Johansson November 12, 2012
2:43:26 AM
          Re: Not properly handling "#if defined"? Michael Metivier November 12, 2012
10:15:35 PM
 
Subject: Not properly handling "#if defined"?
Date: November 10, 2012
12:02:57 PM
Name: Michael Metivier
Email: mmetivier at gentex dot com
Message:
I am using PC-Lint 9.0h and setting up a GCC
project for the first time, using MinGW with GCC
v4.6.2.  I completed the documented process to
create the lint_cmac.h file and updated the
configuration to use the co-gcc.lnt indirect file.
 The first test gave me several obviously
incorrect errors like

Undeclared identifier 'UINT32_MAX' [MISRA 2004
Rule 1.2]

when the include of stdint.h plainly visible.  To
investigate this, I ran the PC-Lint preprocessor
on a problem file with the "-v1" verbosity option.
 I noted large gaps in several header files that I
thought should be there, including one in Lint's
own co-gcc.h file.  This corresponded to the check

#if defined(__cplusplus)
#       include "lint_cppmac.h"
#else
#       include "lint_cmac.h"
#endif

The output generated by the preprocessor run
indicates that lint_cmac.h is not included at all.
 This occurs in several of GCC's standard headers,
including stdint, which caused required symbols to
not be defined.  By rewriting the "#if defined" as
#ifdef, the processing is handled properly.  We
have control of the PC-Lint files, but modifying
compiler headers is not something we really want
to get into.  This can't possibly be intended.  Is
there anything we can do about it?
Reply to this Message! Previous Message Next Message
 
Subject: Re: Not properly handling "#if defined"?
Date: November 12, 2012
2:43:26 AM
Name: Henrik Johansson
Email: saabgroup
Message:
Restart from scratch. You shall not need to 
modify any compiler headers. #if defined shall 
work of course. Just make the configuration in 
small steps: Don't start your analysis on the 
MISRA level! Do some small tests at -w2 level, 
and later include a few system headers. If there 
is a problem, make a stand-alone sample valid for 
the on-line demo an present it in this forum.
Reply to this Message! Previous Message Next Message
 
Subject: Re: Not properly handling "#if defined"?
Date: November 12, 2012
10:15:35 PM
Name: Michael Metivier
Email: mmetivier at gentex dot com
Message:
I must admit my own error on this one.  The
co-gcc.lnt file includes "+cpp(.cc,.C)", which,
due to the default enabling of the filename
folding, caused all of our ".c" source files to be
analyzed as cpp files.  Hence, the analysis
proceeded as expected under these conditions.

For posterity, anyone doing analysis of a C
project using GCC should disable filename folding
using the "-fff" option.
Reply to this Message! Previous Message Next Message