From Daniel.Nikolic at telefon-gradnja.hr Thu May 18 05:04:56 2006 From: Daniel.Nikolic at telefon-gradnja.hr (=?iso-8859-2?Q?Daniel_Nikoli=E6?=) Date: Thu May 18 05:05:08 2006 Subject: [splint-discuss] A question about parsing windows.h Message-ID: Hello, I'm trying to evaluate Splint and I'm quite satisfied, but I don't know what to do with errors I get all the time with Windows header files: Splint 3.1.1 --- 12 April 2003 < Location unknown >: Field name reused: Code cannot be parsed. For help on parse errors, see splint -help parseerrors. (Use -syntax to inhibit warning) < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of < Location unknown >: Previous use of (file analyzed has #inlcude ) (I'm using Visual Studio .NET C/C++ compiler) My .splintrc: -larchpath D:\PROGRA~1\splint~1.1\lib -lclimportdir D:\PROGRA~1\splint~1.1\imports -sysdirs C:\Progra~1\Micros~2.NET\Vc7\PlatformSDK\include;C:\Progra~1\Micros~2.NET\Vc7\include -linelen 600 +charintliteral -booltype BOOL #includes -I. -IC:\Progra~1\Micros~2.NET\Vc7\PlatformSDK\include -IC:\Progra~1\Micros~2.NET\Vc7\include #my include dirs omitted #Visual Studio -D_M_IX86=600 -DWIN32 -D_WIN32 -D_MSC_EXTENSIONS -D_WIN32_WINNT=0x0500 -likelybool -D__int64=long -D_int64=int -D_wtoi=atoi -DSTRICT I'd like to use Splint under Windows, but I see there is not much support. Anyone has any experience? By the way, there are some errors in the Splint manual, ver 3.1.1 (27 April 2003). Enyone knows whom should I mail this? Daniel Nikolic From Michael.Wojcik at MicroFocus.com Thu May 18 10:17:17 2006 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Thu May 18 10:18:40 2006 Subject: [splint-discuss] A question about parsing windows.h Message-ID: <11352F9641010A418AD5057945A3A6594CBC09@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > Daniel Nikolic > Sent: Thursday, 18 May, 2006 05:05 > > I'm trying to evaluate Splint and I'm quite > satisfied, but I don't know what to do with > errors I get all the time with Windows > header files: You could try adding the following to your Splint configuration. These settings cleaned up the false positives in the MS headers for VC6 for me: # Help Splint with Windows idiosyncrasies -D_M_IX86=400 -DWIN32 -D_NTSYSTEM -D_WIN32_WINNT=0x0400 -DWINVER=600 -DNOGDI -DNOKERNEL -DNOUSER -DWIN32_LEAN_AND_MEAN -D__int64=long -D_int64=int -D_wtoi=atoi -DSTRICT -D__try= -D__except(x)= -DGetExceptionCode()=1 They're based on the settings suggested on the Splint site, with some additions of my own. Note that they may not be appropriate for all Windows apps (particularly WIN32_LEAN_AND_MEAN), so you may have to tweak them. I note that the Splint config you supplied doesn't have all of these. For VC8 (Visual Studio 2005) you may need other definitions, since it suffers from "safe coding" diarrhea. (Plus ten points for good intentions, minus several thousand for the actual implementation...) I skipped over VC7 (VS2003) myself (life's too short to try to deal with every bright idea coming out of Microsoft's compiler teams), but I imagine it has Splint issues all its own. > Splint 3.1.1 --- 12 April 2003 > > < Location unknown >: Field name reused: I must say that this "Location unknown" business really annoys me; if I ever have time to do some serious repair work on Splint, this will be one of the first things that I fix. What possible reason could there be for the parser to not know what file and line it's on? > My .splintrc: > > -sysdirs > C:\Progra~1\Micros~2.NET\Vc7\PlatformSDK\include;C:\Progra~1\Micros~2.NE T\Vc7\include I haven't found it necessary to set any sysdirs in my Splint configuration for Windows. I'm not sure Splint correctly handles the 8.3-LSN name conversions anyway. > I'd like to use Splint under Windows, but I > see there is not much support. Anyone has > any experience? I've had some luck with it. I'm using it in a fairly casual manner (weakened checking, none of the advanced features), but I do have it to the point where I've eliminated the false positives and still catch a fair number of errors. > By the way, there are some errors in the Splint > manual, ver 3.1.1 (27 April 2003). Enyone knows > whom should I mail this? There doesn't appear to be a current Splint maintainer. A call went out on this list around the beginning of the year, and I don't recall anyone stepping up. (I might have missed it, though.) -- Michael Wojcik Principal Software Systems Developer, Micro Focus From Daniel.Nikolic at telefon-gradnja.hr Fri May 19 07:32:23 2006 From: Daniel.Nikolic at telefon-gradnja.hr (=?iso-8859-2?Q?Daniel_Nikoli=E6?=) Date: Fri May 19 07:32:33 2006 Subject: [splint-discuss] RE: RE: A question about parsing windows.h (Visual Studio) Message-ID: Thank you Michael! I managed to ged rid of errors by using the following .splintc: ##### BEGIN .splintrc ##### -booltype BOOL #naming -globalprefix g_ +globalprefixexclude #includes -I. -IC:\Progra~1\Micros~2.NET\Vc7\PlatformSDK\include -IC:\Progra~1\Micros~2.NET\Vc7\include #my includes ommited... #Visual Studio .NET -D_M_IX86=600 -DWIN32 -D_WIN32 -D_NTSYSTEM -D_WIN32_WINNT=0x0500 -DWINVER=600 -DNOGDI -DNOKERNEL -DNOUSER -DWIN32_LEAN_AND_MEAN -D__int64=long -D_int64=int -D_wtoi=atoi -DSTRICT -D__try= -D__except(x)= -Dlint -DGetExceptionCode()=1 ##### END .splintrc ##### Further, I had to comment out this in SDK (winnt.h): #ifndef S_SPLINT_S // commented out to satisfy Splint typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { union { struct { DWORD NameOffset:31; DWORD NameIsString:1; }; DWORD Name; WORD Id; }; union { DWORD OffsetToData; struct { DWORD OffsetToDirectory:31; DWORD DataIsDirectory:1; }; }; } IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; #endif // defined S_SPLINT_S It is a structure containing two anonymous unions as members, and this confuses Splint, it seems. Because I turned on WIN32_LEAN_AND_MEAN in .splintc, I had to modify windows.h to include winsock.h always. One can go further and annotate Windows API (I put /*@out@*/ in GetCurrentTime()), etc. Well, thank you very much for your help; if I find more ways to get splint to be useful with Windows, I'll post to the forum! Daniel Nikolic From Michael.Wojcik at MicroFocus.com Fri May 19 10:01:56 2006 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Fri May 19 10:03:04 2006 Subject: [splint-discuss] RE: RE: A question about parsing windows.h (VisualStudio) Message-ID: <11352F9641010A418AD5057945A3A6594CBC19@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > Daniel Nikolic > Sent: Friday, 19 May, 2006 07:32 > > Further, I had to comment out this in SDK (winnt.h): > > #ifndef S_SPLINT_S // commented out to satisfy Splint > > typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { > union { > struct { > DWORD NameOffset:31; > DWORD NameIsString:1; > }; > DWORD Name; > WORD Id; > }; > union { > DWORD OffsetToData; > struct { > DWORD OffsetToDirectory:31; > DWORD DataIsDirectory:1; > }; > }; > } IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; > > #endif // defined S_SPLINT_S > > It is a structure containing two anonymous unions as > members, and this confuses Splint, it seems. Splint's correct to complain about it. It's a violation of the C standard. Unfortunately this extension (which has little utility and produces nonportable code) is provided by a variety of those implementations written by people who think their whims are more important than the language standard. (Just yesterday I had to clean up a header written by someone who's never had to write portable code - it had this problem, and the related one of "struct collapse" where members of anonymous structs or unions are referred to as members of the enclosing struct or union. Awful.) > Because I turned on WIN32_LEAN_AND_MEAN in .splintc, > I had to modify windows.h to include winsock.h always. You can just include winsock.h (or, better, winsock2.h) explicitly. I think that's a better option, as an update to the SDK won't break your build. -- Michael Wojcik Principal Software Systems Developer, Micro Focus From philgoetz at gmail.com Fri May 19 13:04:44 2006 From: philgoetz at gmail.com (Philip Goetz) Date: Fri May 19 13:04:49 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? Message-ID: <6fdad3790605191004o480bfbbn5e0702ae150c9c3a@mail.gmail.com> Hi - I'm trying to get splint to work under Cygwin. My problem is that I can't get it to read any of the paths I give it. This is how I try to set the paths in my .bashrc: alias splint="splint -I/usr/include/c++/3.3.3:usr/local/include" # LARCH_PATH is for splint export SPLINT=/cygdrive/c/lang/C/splint-3.0.1.6 export LCLIMPORTDIR=$SPLINT/imports export LARCH_PATH=$SPLINT/lib:/usr/lib:/usr/local/lib Splint then fails to find, well, everything. It fails to find standard.lcd, which is on LARCH_PATH, and it fails to find every single include file in /usr/include/c++/3.3.3 $ printenv LARCH_PATH /cygdrive/c/lang/C/splint-3.0.1.6/lib:/usr/lib:/usr/local/lib $ printenv LCLIMPORTDIR /cygdrive/c/lang/C/splint-3.0.1.6/imports $ alias splint alias splint='splint -I/usr/include/c++/3.3.3:usr/local/include' $ !splint splint main.cpp Splint 3.0.1.6 --- 11 Feb 2002 Command Line: Unrecognized file extension: main.cpp (assuming .cpp is C source code) warn when command line file does not have a recognized extension (Use -fileextensions to inhibit warning) Cannot find standard library: standard.lcd Check LARCH_PATH environment variable. main.cpp(6,19): Cannot find include file cstdlib on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(7,19): Cannot find include file fstream on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(8,20): Cannot find include file iostream on search path: /usr/include/c ++/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(11,20): Cannot find include file string.h on search path: /usr/include/ c++/3.3.3:usr/local/include;C:/include;C:/local/include In file included from main.cpp(12) BitArray/bitarray.h(49,18): Cannot find include file vector on search path: /usr /include/c++/3.3.3:usr/local/include;C:/include;C:/local/include BitArray/bitarray.h(50,19): Cannot find include file ostream on search path: /us r/include/c++/3.3.3:usr/local/include;C:/include;C:/local/include BitArray/bitarray.h(60,49): #warning CHAR_BIT not defined. Assuming 8 bits. In file included from main.cpp(16) dna.h(6,43): Cannot find include file ostream on search path: /usr/include/c++/3 .3.3:usr/local/include;C:/include;C:/local/include In file included from main.cpp(17) dnaerr.h(4,43): Cannot find include file ostream on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include $ ls /cygdrive/c/lang/C/splint-3.0.1.6/lib/standard.lcd /cygdrive/c/lang/C/splint-3.0.1.6/lib/standard.lcd $ ls /usr/include/c++/3.3.3/iostream /usr/include/c++/3.3.3/iostream Any help? Phil Goetz phil_goetz@yahoo.com From smigiel at agere.com Fri May 19 14:01:36 2006 From: smigiel at agere.com (Smigielski, Robert L (Robert)) Date: Fri May 19 14:01:59 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? Message-ID: <563E93916841ED4AB163CA4FC9E4B79F65A72C@PAUMAILU02.ags.agere.com> I use splint under cygwin regularly so I know it works. I don't know the solution to your problem, but here are my cygwin reported variables: $ env|grep -i splint LCLIMPORTDIR=/usr/share/splint/imports LARCH_PATH=/usr/share/splint/lib PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/ecos-c/MikTex/miktex/b in:/:/usr/bin:/ecos-c/program files/arm/adsv1_2/ bin:/ecos-c/program files/mks/integrityclient/bin:/ecos-c/WINNT/system32:/ecos-c/WINNT:/ecos -c/WINNT/system32/wbem:/ecos -c/python24:/ecos-c/program files/gmake/mingw/bin:/ecos-c/PROGRA~1/TelnetServer/SLnet:/ecos-c/splint -3/bin:/ecos-c/Progr am Files/doxygen/bin:/ecos-c/vslick/win:/:/usr/bin:/ecos-c/LabEnv/drivers Here are the environment variables reported in my Win 2000 OS which are set from My Computer->properties->Advanced User variables for smigiel LARCH_PATH /usr/share/splint/lib LCLIMPORTDIR /usr/share/splint/imports path c:\vslick\win;c:\cygwin;c:\cygwin\bin;c:\LabEnv\drivers System variables Path c:\cygwin;c:\cygwin\bin;%systemroot%\system32;%systemroot%;%systemroot%\ system32\wbem;c:\python24;c:\splint-3\bin; Robert Smigielski Agere Systems 1+ 610 712 8906 Room 10D 206B LVCC -----Original Message----- From: splint-discuss-bounces@cs.virginia.edu [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of Philip Goetz Sent: Friday, May 19, 2006 1:05 PM To: splint-discuss@ares.cs.virginia.edu Subject: [splint-discuss] Is this a splint problem, a Cygwin problem,or a stupidity problem? Hi - I'm trying to get splint to work under Cygwin. My problem is that I can't get it to read any of the paths I give it. This is how I try to set the paths in my .bashrc: alias splint="splint -I/usr/include/c++/3.3.3:usr/local/include" # LARCH_PATH is for splint export SPLINT=/cygdrive/c/lang/C/splint-3.0.1.6 export LCLIMPORTDIR=$SPLINT/imports export LARCH_PATH=$SPLINT/lib:/usr/lib:/usr/local/lib Splint then fails to find, well, everything. It fails to find standard.lcd, which is on LARCH_PATH, and it fails to find every single include file in /usr/include/c++/3.3.3 $ printenv LARCH_PATH /cygdrive/c/lang/C/splint-3.0.1.6/lib:/usr/lib:/usr/local/lib $ printenv LCLIMPORTDIR /cygdrive/c/lang/C/splint-3.0.1.6/imports $ alias splint alias splint='splint -I/usr/include/c++/3.3.3:usr/local/include' $ !splint splint main.cpp Splint 3.0.1.6 --- 11 Feb 2002 Command Line: Unrecognized file extension: main.cpp (assuming .cpp is C source code) warn when command line file does not have a recognized extension (Use -fileextensions to inhibit warning) Cannot find standard library: standard.lcd Check LARCH_PATH environment variable. main.cpp(6,19): Cannot find include file cstdlib on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(7,19): Cannot find include file fstream on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(8,20): Cannot find include file iostream on search path: /usr/include/c ++/3.3.3:usr/local/include;C:/include;C:/local/include main.cpp(11,20): Cannot find include file string.h on search path: /usr/include/ c++/3.3.3:usr/local/include;C:/include;C:/local/include In file included from main.cpp(12) BitArray/bitarray.h(49,18): Cannot find include file vector on search path: /usr /include/c++/3.3.3:usr/local/include;C:/include;C:/local/include BitArray/bitarray.h(50,19): Cannot find include file ostream on search path: /us r/include/c++/3.3.3:usr/local/include;C:/include;C:/local/include BitArray/bitarray.h(60,49): #warning CHAR_BIT not defined. Assuming 8 bits. In file included from main.cpp(16) dna.h(6,43): Cannot find include file ostream on search path: /usr/include/c++/3 .3.3:usr/local/include;C:/include;C:/local/include In file included from main.cpp(17) dnaerr.h(4,43): Cannot find include file ostream on search path: /usr/include/c+ +/3.3.3:usr/local/include;C:/include;C:/local/include $ ls /cygdrive/c/lang/C/splint-3.0.1.6/lib/standard.lcd /cygdrive/c/lang/C/splint-3.0.1.6/lib/standard.lcd $ ls /usr/include/c++/3.3.3/iostream /usr/include/c++/3.3.3/iostream Any help? Phil Goetz phil_goetz@yahoo.com _______________________________________________ splint-discuss mailing list splint-discuss@ares.cs.Virginia.EDU http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss From Michael.Wojcik at MicroFocus.com Fri May 19 14:25:22 2006 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Fri May 19 14:28:28 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? Message-ID: <11352F9641010A418AD5057945A3A6594CBC20@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > Philip Goetz > Sent: Friday, 19 May, 2006 13:05 > > Hi - I'm trying to get splint to work under Cygwin. Disclaimer: I've never tried to run splint under cygwin; I just use the native Win32 build. (I have MS Services for Unix installed, and cygwin would conflict with them.) > My problem is that I can't get it to read any of the paths I give it. > This is how I try to set the paths in my .bashrc: > > alias splint="splint -I/usr/include/c++/3.3.3:usr/local/include" Have you tried: alias splint="splint -I/usr/include/c++/3.3.3 -I/usr/local/include" I've never seen -I used to pass a path list, only the pathname of a directory, as is customary for C compilers; and I don't see anything in the splint documentation that would lead me to expect it to work. > # LARCH_PATH is for splint > export SPLINT=/cygdrive/c/lang/C/splint-3.0.1.6 Is this actually a cygwin build of splint? You use a cygwin path here, but in the splint error messages you show below, it appears to have been translated to a conventional Windows path. Something's not right there. > $ !splint > splint main.cpp > Splint 3.0.1.6 --- 11 Feb 2002 > > Command Line: Unrecognized file extension: > main.cpp (assuming .cpp is C source code) I don't think you're going to have much luck running splint against C++ source anyway. It's a C analyzer. -- Michael Wojcik Principal Software Systems Developer, Micro Focus From smigiel at agere.com Fri May 19 14:38:34 2006 From: smigiel at agere.com (Smigielski, Robert L (Robert)) Date: Fri May 19 14:38:58 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? Message-ID: <563E93916841ED4AB163CA4FC9E4B79F65A730@PAUMAILU02.ags.agere.com> I agree with you - I too am suspicious of the syntax of using the ":" in an include path directive: > My problem is that I can't get it to read any of the paths I give it. > This is how I try to set the paths in my .bashrc: > > alias splint="splint -I/usr/include/c++/3.3.3:usr/local/include" Have you tried: alias splint="splint -I/usr/include/c++/3.3.3 -I/usr/local/include" I've never seen -I used to pass a path list, only the pathname of a directory, as is customary for C compilers; and I don't see anything in the splint documentation that would lead me to expect it to work. My splint tool is the splint that comes from the cygwin installation. I recall I could NOT GET the Win32 splint installation to work under cygwin. The cygwin install tree has splint somewhere in the "develop" or "compiler" tree, forgot exactly where. I recommend that you un-install the Windows version of splint. Clean up any env variables in the Windows system/user variables. Then install the cygwin splint. From rasmit.ranjan at wipro.com Mon May 22 07:29:19 2006 From: rasmit.ranjan at wipro.com (rasmit.ranjan@wipro.com) Date: Mon May 22 07:31:27 2006 Subject: [splint-discuss] parse error in sparsing kernel module using splint Message-ID: <380D9721A8E2114485644D71E87C6AB201DF806E@PNE-HJN-MBX01.wipro.com> Hi all, I am new to splint. I tried using it for sparsing a kernel module. I went through the mailing list and got a Makefile written by Brian Quinlan which I am using. I am getting the following parse error. Can anyone suggest me any solution for this ? ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) general.c:352: at source point ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) general.c:352: at source point ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) general.c:352: at source point ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) general.c:352: at source point ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) general.c:352: at source point ../../../../include/linux/jiffies.h:212:1: *** Internal Bug at general.c:352: llassert failed: x >= 0 [errno: 2] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) /usr/include/libio.h:476:18: Parse Error: Inconsistent function parameter syntax: __gnuc_va_list : . (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. Thanks and regards, Rasmit. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From philgoetz at gmail.com Mon May 22 18:00:31 2006 From: philgoetz at gmail.com (Philip Goetz) Date: Mon May 22 18:05:26 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? In-Reply-To: <563E93916841ED4AB163CA4FC9E4B79F65A730@PAUMAILU02.ags.agere.com> References: <563E93916841ED4AB163CA4FC9E4B79F65A730@PAUMAILU02.ags.agere.com> Message-ID: <6fdad3790605221500rd338676y71b65789a3c08af0@mail.gmail.com> On 5/19/06, Smigielski, Robert L (Robert) wrote: > I agree with you - I too am suspicious of the syntax of using the ":" in > an include > path directive: I think you're right. (Your mail gave me a bit of trouble since gmail uses a font in which I is identical to l.) Since I want to use C++, though, I guess I won't be using splint. Is there something similar for C++ or Java? From philgoetz at gmail.com Mon May 22 18:00:31 2006 From: philgoetz at gmail.com (Philip Goetz) Date: Mon May 22 18:10:38 2006 Subject: [splint-discuss] Is this a splint problem, a Cygwin problem, or a stupidity problem? In-Reply-To: <563E93916841ED4AB163CA4FC9E4B79F65A730@PAUMAILU02.ags.agere.com> References: <563E93916841ED4AB163CA4FC9E4B79F65A730@PAUMAILU02.ags.agere.com> Message-ID: <6fdad3790605221500rd338676y71b65789a3c08af0@mail.gmail.com> On 5/19/06, Smigielski, Robert L (Robert) wrote: > I agree with you - I too am suspicious of the syntax of using the ":" in > an include > path directive: I think you're right. (Your mail gave me a bit of trouble since gmail uses a font in which I is identical to l.) Since I want to use C++, though, I guess I won't be using splint. Is there something similar for C++ or Java? From rasmit.ranjan at wipro.com Tue May 23 05:51:55 2006 From: rasmit.ranjan at wipro.com (rasmit.ranjan@wipro.com) Date: Tue May 23 05:52:39 2006 Subject: [splint-discuss] Parse error due to byteorder.h Message-ID: <380D9721A8E2114485644D71E87C6AB201E569D1@PNE-HJN-MBX01.wipro.com> Hi all, I am facing some problem while using splint. I am getting parse error in byteorder.h. It is showing the following output. ../../../../include/asm/byteorder.h:37:7: Parse Error: (For help on parse errors, see splint -help parseerrors. ) *** Cannot continue. make:*** [do_splint] Error 1 So can anyone suggest any way to overcome this error ? Is there any flag which could help ? Please suggest. Thanks, Rasmit. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060523/1f8e66b0/attachment.htm From ok at cs.otago.ac.nz Tue May 23 18:57:21 2006 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Tue May 23 18:57:39 2006 Subject: [splint-discuss] Parse error due to byteorder.h Message-ID: <200605232257.k4NMvLaU067673@atlas.otago.ac.nz> wrote: I am facing some problem while using splint. I am getting parse error in byteorder.h. It is showing the following output. ../../../../include/asm/byteorder.h:37:7: Parse Error: (For help on parse errors, see splint -help parseerrors. ) *** Cannot continue. make:*** [do_splint] Error 1 So can anyone suggest any way to overcome this error ? How about showing us the line(s) of code involved? I note that the /usr/include/asm/byteorder.h on a Linux box I have access to has a line #warning using private kernel header; include instead! and that its line 37 is just #endif. So it's really not at all clear what splint dislikes and won't be until you show us. Is there any flag which could help ? Please suggest. What did 'splint -help parseerrors' say? From rasmit.ranjan at wipro.com Thu May 25 00:42:45 2006 From: rasmit.ranjan at wipro.com (rasmit.ranjan@wipro.com) Date: Thu May 25 00:43:26 2006 Subject: [splint-discuss] Parse error due to byteorder.h Message-ID: <380D9721A8E2114485644D71E87C6AB201E57289@PNE-HJN-MBX01.wipro.com> > Message: 1 > Date: Wed, 24 May 2006 10:57:21 +1200 (NZST) > From: "Richard A. O'Keefe" > Subject: Re: [splint-discuss] Parse error due to byteorder.h > To: splint-discuss@cs.virginia.edu > Message-ID: <200605232257.k4NMvLaU067673@atlas.otago.ac.nz> > > wrote: > I am facing some problem while using splint. > I am getting parse error in byteorder.h. It is showing > the following > output. > > > ../../../../include/asm/byteorder.h:37:7: > Parse Error: (For help on parse errors, see splint -help > parseerrors. ) > *** Cannot continue. > make:*** [do_splint] Error 1 > > > So can anyone suggest any way to overcome this error ? > > How about showing us the line(s) of code involved? > > I note that the /usr/include/asm/byteorder.h on a Linux box I > have access to has a line > > #warning using private kernel header; include instead! I replaced byteorder.h with endian.h in my module but it didn't work. Still giving same error. > > and that its line 37 is just #endif. So it's really not at > all clear what splint dislikes and won't be until you show us. > > Is there any flag which could help ? Please suggest. > > What did 'splint -help parseerrors' say? > No 'splint -help parseerrors' does not help as wel. Then what next ? Is there any other way out? > > ------------------------------ Thanks, Rasmit. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From ok at cs.otago.ac.nz Fri May 26 00:23:51 2006 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Fri May 26 00:24:05 2006 Subject: [splint-discuss] Parse error due to byteorder.h Message-ID: <200605260423.k4Q4Np5p086324@atlas.otago.ac.nz> I wrote: > HOW ABOUT SHOWING US THE LINE(S) OF CODE INVOLVED? still has not done this. No 'splint -help parseerrors' does not help as wel. What do you *mean* "does not help"? For example, "splint -help parseerrors" says, amongst other things, Splint supports some of the GNU (gcc) compiler extensions, if the +gnuextensions flag is set. You may be able to workaround other compiler extensions by using a pre-processor define. Alternately, you can surround the unparseable code with # ifndef S_SPLINT_S ... # endif Have you tried setting the +gnuextensions flag? What happened when you did? What particular extension is giving splint trouble? IT WOULD HELP A LOT IF YOU SHOWED US THE LINES THAT SPLINT IS COMPLAINING ABOUT; we don't have the same .h file as you. Is it something you could try giving a #define for so that what splint sees is different from what gcc sees? Is it possible for you to make a copy of the .h file, put #ifndef S_SPLINT_S around the offending code like -help parseerrors suggests, and include that .h file instead of the original? Then what next ? Is there any other way out? I ask again, try SHOWING us the actual lines of code. At least some of us do not have the same version of the file as you do. From rasmit.ranjan at wipro.com Mon May 29 00:32:46 2006 From: rasmit.ranjan at wipro.com (rasmit.ranjan@wipro.com) Date: Mon May 29 00:33:16 2006 Subject: [splint-discuss] Re: Parse error due to byteorder.h Message-ID: <380D9721A8E2114485644D71E87C6AB201EAA68F@PNE-HJN-MBX01.wipro.com> > I wrote: > > HOW ABOUT SHOWING US THE LINE(S) OF CODE INVOLVED? > > still has not done this. > > No 'splint -help parseerrors' does not help as wel. > > What do you *mean* "does not help"? > > For example, "splint -help parseerrors" says, amongst other things, > > Splint supports some of the GNU (gcc) compiler extensions, if the > +gnuextensions flag is set. You may be able to workaround other > compiler extensions by using a pre-processor define. Alternately, > you can surround the unparseable code with > > # ifndef S_SPLINT_S > ... > # endif > > Have you tried setting the +gnuextensions flag? > What happened when you did? On including +gnuextensions flag it gives setting +gnuextensions redundant with current value And same parse error comes. Also I tried using #ifndef S_SPLINT_S....but did not work. Still it gives the same error. > > What particular extension is giving splint trouble? > IT WOULD HELP A LOT IF YOU SHOWED US THE LINES THAT SPLINT IS > COMPLAINING ABOUT; we don't have the same .h file as you. > Is it something you could try giving a #define for so that > what splint sees is different from what gcc sees? > > Is it possible for you to make a copy of the .h file, put > #ifndef S_SPLINT_S around the offending code like -help > parseerrors suggests, and include that .h file instead of the > original? No this is not possible. In my case, I have a module having more than 20 .c files and some of the .h files. In one of the .h file I have included byteorder.h. But even if I remove this file still splint gives same sparse error in byteorder.h. That means byteorder.h is getting linked indirectly from any other .h file I have included. Anyway I am sending you the file byteorder.h. Splint gives sparse error in line no 37, col no 7. and the error is ../../../../include/asm/byteorder.h:37:7: Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. make: *** [do_splint] Error 1 #ifndef _I386_BYTEORDER_H #define _I386_BYTEORDER_H #include #include #ifdef __GNUC__ /* For avoiding bswap on i386 */ #ifdef __KERNEL__ #include #endif static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) { #ifdef CONFIG_X86_BSWAP __asm__("bswap %0" : "=r" (x) : "0" (x)); #else __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ "rorl $16,%0\n\t" /* swap words */ "xchgb %b0,%h0" /* swap higher bytes */ :"=q" (x) : "0" (x)); #endif return x; } static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val) { union { struct { __u32 a,b; } s; __u64 u; } v; v.u = val; #ifdef CONFIG_X86_BSWAP asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) // This line gives the parse error : "0" (v.s.a), "1" (v.s.b)); #else v.s.a = ___arch__swab32(v.s.a); v.s.b = ___arch__swab32(v.s.b); asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b)); #endif return v.u; } /* Do not define swab16. Gcc is smart enough to recognize "C" version and convert it into rotation or exhange. */ #define __arch__swab64(x) ___arch__swab64(x) #define __arch__swab32(x) ___arch__swab32(x) #define __BYTEORDER_HAS_U64__ #endif /* __GNUC__ */ #include #endif /* _I386_BYTEORDER_H */ > > Then what next ? Is there any other way out? > > I ask again, try SHOWING us the actual lines of code. > At least some of us do not have the same version of the file > as you do. > > > > ------------------------------ > > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss > > > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From ptp at lysator.liu.se Mon May 29 06:05:20 2006 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Mon May 29 06:05:41 2006 Subject: [splint-discuss] Re: Parse error due to byteorder.h In-Reply-To: <380D9721A8E2114485644D71E87C6AB201EAA68F@PNE-HJN-MBX01.wipro.com> References: <380D9721A8E2114485644D71E87C6AB201EAA68F@PNE-HJN-MBX01.wipro.com> Message-ID: <20060529100520.GA2426@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> On Mon, May 29, 2006 at 10:02:46AM +0530, rasmit.ranjan@wipro.com wrote: > > Is it possible for you to make a copy of the .h file, put > > #ifndef S_SPLINT_S around the offending code like -help > > parseerrors suggests, and include that .h file instead of the > > original? > > No this is not possible. In my case, I have a module having more than 20 > .c files and some of the .h files. In one of the .h file I have > included byteorder.h. But even if I remove this file still splint gives > same sparse error in byteorder.h. > That means byteorder.h is getting linked indirectly from any other .h > file I have included. Have you tried the -I option. Have you tried reading the splint manual? Anyway, by looking at byteorder.h it doesn't look like having much value to splint. For good checking you should probably write special .h files for these system and/or library interfaces; remove the technical magic that splint barfs on, and focus on splint annotations, i.e., #define:s should be annotated as functions or constants etc. From ok at cs.otago.ac.nz Tue May 30 00:21:37 2006 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Tue May 30 00:21:55 2006 Subject: [splint-discuss] Re: Parse error due to byteorder.h Message-ID: <200605300421.k4U4Lb4c116406@atlas.otago.ac.nz> OK, now we are getting somewhere. I must emphasise that the code in question is highly version-specific Linux internal code which users are never supposed to see. For example, it took me a fair bit of editing before I could make *gcc* accept the header in question, on the Linux box I tried. Also I tried using #ifndef S_SPLINT_S....but did not work. Still it gives the same error. Obviously you *DIDN'T* put that around the right code. No this is not possible. In my case, I have a module having more than 20 .c files and some of the .h files. In one of the .h file I have included byteorder.h. Yes, it *IS* possible to use S_SPLINT_S. Here's what you do. You say that ONE of the .h files includes byteorder.h. (I stress once more that USER code should not be using this file. User code should never mention type names like __u32. I repeat that my copy of byteorder.h says #warning using private kernel header; include instead! User code should be using instead. ) So there is ONE place where you have #include So you change that to #ifdef S_SPLINT_S #define _I386_BYTEORDER_H extern __u32 ___arch_swab32(__u32); extern __u64 ___arch_swab64(__u64); #define __arch_swab32(x) ___arch_swab32(x) #define __arch_swab64(x) ___arch_swab64(x) #else #include #endif But even if I remove this file still splint gives same sparse error in byteorder.h. That means byteorder.h is getting linked indirectly from any other .h file I have included. So find out which! gcc -M foobar.c tells you which headers (including system headers) foobar.c depends on. Find a file where splint complains, use gcc to find which headers it includes, and check each of them to see whether it mentions byteorder.h