On Tue, 2015-06-09 at 10:14 +0200, Ludolf Holzheid wrote:

> You could prepend the directory for the cross-compile headers to the
> include path by placing the appropriate '-I' at the very left of the
> command line.

I'm already doing that, but it still finds the ones in /usr/include

> But if the linux headers are not useful for the project, why do they
> appear in the search path in the first place?  Is the $INCLUDE
> environment variable wrongly set?


Indeed.  I'm trying to find out where they come from.
I appear not to have any environment variables with INCLUDE in them, but
something, somewhere, must tell compilers et al where to look.

I presumed that -sysdirs handles include files of the form <filename.h>
rather than "filename.h", but the /usr/include automagically appears on
the end of the -I path and splint seems to try to use that before
-sysdirs. The cross-compiler paths _do_ appear earlier in the -I path.

One distinct oddity is that if I do not have a -sysdirs, splint can't
find my _normal_ includes ("filename.h"), but those files do _not_ lie
on the path declared in -sysdirs.  Perhaps your comment about "needed
for compilation but not part of the project" is relevant here.

I _have_ noticed that the reported search path has the current working
directory prepended for non-system includes, but that path is terminated
with ; not with : which looks rather suspect.  I've had to reformat the
following so it looks sensible. Drivers.h definitely _is_ in ./Drivers/

main_ctl.c:7:21: Cannot find include file Drivers.h on search path:
  /osmia/srv/Projects/CoolLED/Software/Microscopy/pE-3x/Mainboard;
  .:
  ./Drivers:
  ./CommandParser:
  ./mx_pE3x/inc:
  ./USB/HS_Device:
  /osmia/srv/Projects/Cool_Clib:
  ./STMLIB/STM32F2xx_StdPeriph_Driver/inc:
  ./STMLIB/STM32_USB_OTG_Driver/inc:
  ./STMLIB/STM32_USB_Device_Library/Core/inc:
  ./STMLIB/STM32_USB_Device_Library/Class/dcd/inc:
  "/home/gordon/.rowley_associates_limited/CrossWorks for
ARM/v3/packages/libraries/libctl/include":
  "/use/share/crossworks_for_arm_3.4/include":
  "/home/gordon/.rowley_associates_limited/CrossWorks for
ARM/STM32/include":
  "/home/gordon/.rowley_associates_limited/CrossWorks for
ARM/CMSIS_3/CMSIS/Include";/usr/include;/usr/include



_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

Reply via email to