[splint-discuss] Setting flags in file and in command line

Ludolf Holzheid lholzheid at bihl-wiedemann.de
Thu Nov 15 08:37:47 PST 2007


On Thu, 2007-11-15 15:46:46 +0100, Yegor Ryabkov wrote:
> Greetings,
> 
> I've found that splint (ver. 3.1.1) behaves differently when I list flags
> in command line or in a file (using "-f filename" option).
> 
> Command line case works OK, but when I try to use file with flags, I get
> the following error message:
> 
> Command Line: Setting mode weak after setting mode flags will override set
>                  values of flags: varuse, ignoresigns, matchanyintegral
>   Command line sets flag in abnormal way (Use -warnflags to inhibit warning)
> 
> Flags that are overridden really don't work.
> 
> Command line call is:
> splint -weak *.c (include section) -f lint.ini
> so in fact -weak is set _before_ setting flags, so splint seems to behave
> strangely.
> 
> Is there any way to make splint work correctly with a flag file?

Hi Yegor,

as far as I understand the documentation, the flags from the various
sources are processed in the following order:

 (1) the flags in ~/.splintrc (or the file given by the '-f' flag)
 (2) the flags in ./.splintrc
 (3) the flags on the command line (other than '-f')

thus, the position of '-f' on the command line has no influence on the
order of flags as processed by splint.

To get rid of the warning message, you could move the '-weak' flag
from the command line to the top of 'lint.ini'.

Ludolf

-- 

---------------------------------------------------------------
Ludolf Holzheid             Tel:    +49 621 339960
Bihl+Wiedemann GmbH         Fax:    +49 621 3392239
Floßwörthstraße 41          e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------



More information about the splint-discuss mailing list