From fusionfive at comhem.se Sun Nov 6 18:22:15 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:14 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <436E9027.1050205@comhem.se> Hi, I have problems with parse errors on Ubuntu 5.10: $ cat test.c #include int main(void) { puts("Test..."); return 0; } $ splint test.c Splint 3.1.1 --- 13 Aug 2004 /usr/include/stdio.h:34:21: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include Preprocessing error. (Use -preproc to inhibit warning) In file included from test.c:1 /usr/include/bits/types.h:31:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/stdio.h:36, from test.c:1 /usr/include/_G_config.h:14:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/_G_config.h:24, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/gconv.h:28, from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/gconv.h:31:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/libio.h:53:21: Cannot find include file stdarg.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/stdio.h:72, from test.c:1 Preprocessing error for file: /home/august/eget/prog/c/test/test.c *** Cannot continue. $ locate stddef.h /usr/include/linux/stddef.h /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h /usr/lib/gcc/i486-linux-gnu/3.4.5/include/stddef.h /home/august/eget/prog/oberon/goc/gcc-4.0.1/gcc/ginclude/stddef.h /home/august/gamal-hemkatalog/eget/prog/oberon/goc/gcc-4.0.1/gcc/ginclude/stddef.h $ splint +I/usr/lib/gcc/i486-linux-gnu/4.0.2/include test.c Splint 3.1.1 --- 13 Aug 2004 /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:214:27: Datatype size_t declared with inconsistent type: unsigned long int A function, variable or constant is redefined with a different type. (Use -incondefs to inhibit warning) load file standard.lcd: Specification of size_t: arbitrary unsigned integral type /usr/include/stdio.h:46:25: Mutable abstract type FILE declared without pointer indirection: struct _IO_FILE (violates assignment semantics) LCL semantics requires that a mutable type exhibits sharing semantics. In order for objects to be shared a indirection is necessary in the representation. A mutable type may be represented by a pointer or an abstract mutable type. Handles into static data are fine, too, but will generate this error message unless it is suppressed. (Use -mutrep to inhibit warning) /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:326:13: Datatype wchar_t declared with inconsistent type: int load file standard.lcd: Specification of wchar_t: arbitrary integral type /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:355:22: Datatype wint_t declared with inconsistent type: unsigned int load file standard.lcd: Specification of wint_t: arbitrary integral type /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stdarg.h:43:41: Parse Error: Suspect missing struct or union keyword: __builtin_va_list : unsigned int. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. What should I do? Regards, August From Michael.Wojcik at MicroFocus.com Mon Nov 7 10:09:09 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:17 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > August Karlstrom > Sent: Sunday, 06 November, 2005 18:22 > > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stdarg.h:43:41: Parse Error: > Suspect missing struct or union keyword: __builtin_va_list : > unsigned int. (For help on parse errors, see splint > -help parseerrors.) > *** Cannot continue. Splint doesn't recognize gcc's __builtin_va_list type. I suspect the easiest fix for this would be to define it away in .splintrc (or whatever you're using for a Splint configuration file) with something like: -D__builtin_va_list=va_list -- Michael Wojcik Principal Software Systems Developer, Micro Focus From fusionfive at comhem.se Mon Nov 7 12:10:25 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:17 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> References: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> Message-ID: <436F8A81.7050204@comhem.se> Michael Wojcik wrote: > Splint doesn't recognize gcc's __builtin_va_list type. I suspect the > easiest fix for this would be to define it away in .splintrc (or > whatever you're using for a Splint configuration file) with something > like: > > -D__builtin_va_list=va_list Yes, that did the trick. Thanks. This should really go into the Splint FAQ. August From manuverma19 at yahoo.com Wed Nov 9 00:37:02 2005 From: manuverma19 at yahoo.com (manish verma) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse errors while checking simple kernel modules Message-ID: <20051109053702.52105.qmail@web60419.mail.yahoo.com> Hi All, I'm getting parse errors while checking simple kernel modules on my Linux - 2.6.9-5.18AX machine. _______________________________________________________________________ [root@localhost splint-3.1.1]# splint -I/usr/src/linux-2.6.9-5.18AX/include/ mod.c Splint 3.1.1 --- 12 May 2005 /usr/include/asm/types.h:11:24: Parse Error: Suspect missing struct or union keyword: __signed__ : unsigned short int. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. [root@localhost splint-3.1.1]# _________________________________________________________________________ I tried -D__signed__=signed bthat did not worked. I got another parse errors in /usr/src/linux-2.6.9-5.18AX/include/linux/bitops.h:116:54: I'd be pleased if somebody could help. Regards, Manish Verma --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20051108/2c58e627/attachment.htm From manuverma19 at yahoo.com Wed Nov 9 02:47:59 2005 From: manuverma19 at yahoo.com (manish verma) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Can we use splint to check kernel modules? Message-ID: <20051109074759.6456.qmail@web60417.mail.yahoo.com> Hi, In regard to my previous query. I was wondering whether we can use splint to check kernel modules at all! Regards, Manish Verma --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20051108/477ad568/attachment.htm From Michael.Wojcik at MicroFocus.com Wed Nov 9 08:35:01 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse errors while checking simple kernel modules Message-ID: <11352F9641010A418AD5057945A3A6590739BE@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > manish verma > Sent: Wednesday, 09 November, 2005 00:37 > > I'm getting parse errors while checking simple kernel > modules on my Linux - 2.6.9-5.18AX machine. > > [root@localhost splint-3.1.1]# splint > -I/usr/src/linux-2.6.9-5.18AX/include/ mod.c > Splint 3.1.1 --- 12 May 2005 > /usr/include/asm/types.h:11:24: Parse Error: > Suspect missing struct or union keyword: __signed__ : > unsigned short int. (For help on parse errors, see splint -help > parseerrors.) That seems pretty clear to me. Splint doesn't know about GCC's "renamed keywords", such as "__signed__". (And why should it?) So you need a Splint configuration file that defines the renamed keywords to their standard counterparts. > I tried -D__signed__=signed bthat did not worked. "Did not work" in what sense? Did it not allow Splint to get past that one particular error? > I got another parse errors in > /usr/src/linux-2.6.9-5.18AX/include/linux/bitops.h:116:54: My crystal ball is broken. *What* error did you get there? Take a look at: http://www.splint.org/pipermail/splint-discuss/2005-January.txt which is a discussion of using Splint on Linux kernel modules. I found it after a gruelling five-second Google search. Splint is, in effect, a C implementation. It's an implementation that only generates diagnostics and never produces a successful translation, but in essence when you use Splint you're switching C compilers. That means you have to work around implementation extensions in the source, just as you would in any other C porting exercise. -- Michael Wojcik 517 676-0892 Software Systems Developer Micro Focus http://www.microfocus.com/ From magarwal at NeoMagic.com Fri Nov 11 01:05:21 2005 From: magarwal at NeoMagic.com (Mohit Agarwal) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Splint for C++ Message-ID: Hi, I wanted to know whether there is a variant of Splint for C++. Regards Mohit -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20051111/23efa6ea/attachment.htm From fusionfive at comhem.se Fri Nov 18 10:43:25 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> References: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> Message-ID: <437DF69D.9060205@comhem.se> Michael Wojcik wrote: > Splint doesn't recognize gcc's __builtin_va_list type. I suspect the > easiest fix for this would be to define it away in .splintrc (or > whatever you're using for a Splint configuration file) with something > like: > > -D__builtin_va_list=va_list The setting did work when I first tried it, but now I get the same errors as before, I don't get it. $ cat test.c #include int main(void) { puts("Test..."); return 0; } $ cat ~/.splintrc -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include -D__builtin_va_list=va_list $ splint test.c /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:214:27: Datatype size_t declared with inconsistent type: unsigned long int A function, variable or constant is redefined with a different type. (Use -incondefs to inhibit warning) load file standard.lcd: Specification of size_t: arbitrary unsigned integral type /usr/include/stdio.h:46:25: Mutable abstract type FILE declared without pointer indirection: struct _IO_FILE (violates assignment semantics) LCL semantics requires that a mutable type exhibits sharing semantics. In order for objects to be shared a indirection is necessary in the representation. A mutable type may be represented by a pointer or an abstract mutable type. Handles into static data are fine, too, but will generate this error message unless it is suppressed. (Use -mutrep to inhibit warning) /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:326:13: Datatype wchar_t declared with inconsistent type: int load file standard.lcd: Specification of wchar_t: arbitrary integral type /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:355:22: Datatype wint_t declared with inconsistent type: unsigned int load file standard.lcd: Specification of wint_t: arbitrary integral type /usr/include/stdio.h:88:19: Mutable abstract type fpos_t declared without pointer indirection: _G_fpos_t (violates assignment semantics) /usr/include/stdio.h:88:26: Datatype fpos_t declared with inconsistent type: _G_fpos_t load file standard.lcd: Specification of fpos_t: void * /usr/include/stdio.h:142:25: Variable stdin declared with inconsistent type: struct _IO_FILE * load file standard.lcd: Specification of stdin: FILE * /usr/include/stdio.h:143:25: Variable stdout declared with inconsistent type: struct _IO_FILE * load file standard.lcd: Specification of stdout: FILE * /usr/include/stdio.h:144:25: Variable stderr declared with inconsistent type: struct _IO_FILE * load file standard.lcd: Specification of stderr: FILE * test.c: (in function main) test.c:5:4: Return value (type int) ignored: puts("Test...") Result returned by function call is not used. If this is intended, can cast result to (void) to eliminate message. (Use -retvalint to inhibit warning) /usr/include/stdio.h:146: Variable stdin implemented by a macro load file standard.lcd: Specification of stdin /usr/include/stdio.h:147: Variable stdout implemented by a macro load file standard.lcd: Specification of stdout /usr/include/stdio.h:148: Variable stderr implemented by a macro load file standard.lcd: Specification of stderr /usr/include/stdio.h: (in macro getc) /usr/include/stdio.h:447:30: Function _IO_getc expects arg 1 to be _IO_FILE * gets FILE *: _fp Types are incompatible. (Use -type to inhibit warning) /usr/include/stdio.h: (in macro putc) /usr/include/stdio.h:489:40: Function _IO_putc expects arg 2 to be _IO_FILE * gets FILE *: _fp Finished checking --- 15 code warnings Regards, August From Michael.Wojcik at MicroFocus.com Fri Nov 18 11:29:10 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <11352F9641010A418AD5057945A3A6591F11B6@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > August Karlstrom > Sent: Friday, 18 November, 2005 10:43 > To: Discussions about the Splint annotation-assisted static > analysis project > Subject: Re: [splint-discuss] Parse Errors on Ubuntu > > > Michael Wojcik wrote: > > Splint doesn't recognize gcc's __builtin_va_list type. I > suspect the > > easiest fix for this would be to define it away in .splintrc (or > > whatever you're using for a Splint configuration file) with > something > > like: > > > > -D__builtin_va_list=va_list > > The setting did work when I first tried it, but now I get the same > errors as before, I don't get it. > > $ cat test.c > #include > > int main(void) > { > puts("Test..."); > return 0; > } > > $ cat ~/.splintrc > -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include > -D__builtin_va_list=va_list > > $ splint test.c I don't see any errors about va_list below. These look like different problems. > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:214:27: > Datatype size_t declared with inconsistent type: > unsigned long int > A function, variable or constant is redefined with a > different type. (Use > -incondefs to inhibit warning) > load file standard.lcd: Specification of size_t: > arbitrary unsigned integral type That looks like a splint bug to me. "unsigned long int" *is* an "arbitrary unsigned integral type". It's this sort of thing that makes me want to find some time to tear into splint - not only are there too many false positive, too many of them are self-contradictory. Either splint is greviously confused, or the error text is incorrect. > /usr/include/stdio.h:46:25: Mutable abstract type FILE > declared without > pointer > indirection: struct _IO_FILE (violates assignment semantics) > LCL semantics requires that a mutable type exhibits > sharing semantics. In > order for objects to be shared a indirection is necessary in the > representation. A mutable type may be represented by a > pointer or an > abstract > mutable type. Handles into static data are fine, too, but will > generate this > error message unless it is suppressed. (Use -mutrep to > inhibit warning) I don't know what it's going on about here. I don't have a copy of the GCC 4.0.2 stdio.h handy to see how FILE is declared. However, "typedef struct _IO_FILE FILE" would conform to the C standard, provided "struct _IO_FILE" is defined (because C90 7.9.1 requires FILE to be an object type, for some unguessable reason). Maybe splint wants FILE to be an incomplete structure type (that's what all that blather about "abstract types" seems to imply); but that would break conformance, and when it's splint versus the Standard, the Standard wins. I'd disable mutrep, either globally (with "-mutrep" in .spintrc) or around the inclusion of stdio.h. > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:326:13: > Datatype wchar_t declared with inconsistent type: int > load file standard.lcd: Specification of wchar_t: > arbitrary integral > type > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:355:22: > Datatype wint_t declared with inconsistent type: unsigned int > load file standard.lcd: Specification of wint_t: > arbitrary integral type > /usr/include/stdio.h:88:19: Mutable abstract type fpos_t > declared without > pointer indirection: _G_fpos_t (violates assignment semantics) > /usr/include/stdio.h:88:26: Datatype fpos_t declared with > inconsistent type: > _G_fpos_t > load file standard.lcd: Specification of fpos_t: void * > /usr/include/stdio.h:142:25: Variable stdin declared with > inconsistent type: > struct _IO_FILE * > load file standard.lcd: Specification of stdin: FILE * > /usr/include/stdio.h:143:25: Variable stdout declared with > inconsistent > type: > struct _IO_FILE * > load file standard.lcd: Specification of stdout: FILE * > /usr/include/stdio.h:144:25: Variable stderr declared with > inconsistent > type: > struct _IO_FILE * > load file standard.lcd: Specification of stderr: FILE * > test.c: (in function main) > test.c:5:4: Return value (type int) ignored: puts("Test...") > Result returned by function call is not used. If this is intended, > can cast > result to (void) to eliminate message. (Use -retvalint to inhibit > warning) > /usr/include/stdio.h:146: Variable stdin implemented by a macro > load file standard.lcd: Specification of stdin > /usr/include/stdio.h:147: Variable stdout implemented by a macro > load file standard.lcd: Specification of stdout > /usr/include/stdio.h:148: Variable stderr implemented by a macro > load file standard.lcd: Specification of stderr > /usr/include/stdio.h: (in macro getc) > /usr/include/stdio.h:447:30: Function _IO_getc expects arg 1 to be > _IO_FILE * > gets FILE *: _fp > Types are incompatible. (Use -type to inhibit warning) > /usr/include/stdio.h: (in macro putc) > /usr/include/stdio.h:489:40: Function _IO_putc expects arg 2 to be > _IO_FILE * > gets FILE *: _fp > > Finished checking --- 15 code warnings I'd put -mutrep and -icondefs in .splintrc unless you want those checks, in which case I'd disable them around the inclusion of standard headers: /*@-mutrep -icondefs@*/ #include [other standard headers] /*@=mutrep =icondefs@*/ (I haven't tried that, but it looks right.) You may also want to look at the discussion of splint's standard library handling in the splint docs. (It's chapter 14 in the version I have.) The volume of output you're getting here makes it look like you might have the "strict" version of the standard library configuration enabled. -- Michael Wojcik Principal Software Systems Developer, Micro Focus From brian.quinlan at iolfree.ie Sat Nov 19 20:03:52 2005 From: brian.quinlan at iolfree.ie (Brian Quinlan) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <437DF69D.9060205@comhem.se> References: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> <437DF69D.9060205@comhem.se> Message-ID: <1132448632.5077.9.camel@akebono> Hi August, I run splint version 3.1.1 without a .splintrc file on Fedora Core 3 and get the following output for your test.c file: [brian@akebono tmp]$ splint test.c Splint 3.1.1 --- 15 Jun 2004 test.c: (in function main) test.c:5:5: Return value (type int) ignored: puts("Test...") Result returned by function call is not used. If this is intended, can cast result to (void) to eliminate message. (Use -retvalint to inhibit warning) Finished checking --- 1 code warning Could the -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include in your .splintrc be causing a problem? Splint has its own built-in versions of the standard headers (in standard.lcd, I think, but I'm open to correction on that). Bye, Brian On Fri, 2005-11-18 at 16:43 +0100, August Karlstrom wrote: > Michael Wojcik wrote: > > Splint doesn't recognize gcc's __builtin_va_list type. I suspect the > > easiest fix for this would be to define it away in .splintrc (or > > whatever you're using for a Splint configuration file) with something > > like: > > > > -D__builtin_va_list=va_list > > The setting did work when I first tried it, but now I get the same > errors as before, I don't get it. > > $ cat test.c > #include > > int main(void) > { > puts("Test..."); > return 0; > } > > $ cat ~/.splintrc > -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include > -D__builtin_va_list=va_list > > $ splint test.c > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:214:27: > Datatype size_t declared with inconsistent type: unsigned long int > A function, variable or constant is redefined with a different type. (Use > -incondefs to inhibit warning) > load file standard.lcd: Specification of size_t: > arbitrary unsigned integral type > /usr/include/stdio.h:46:25: Mutable abstract type FILE declared without > pointer > indirection: struct _IO_FILE (violates assignment semantics) > LCL semantics requires that a mutable type exhibits sharing semantics. In > order for objects to be shared a indirection is necessary in the > representation. A mutable type may be represented by a pointer or an > abstract > mutable type. Handles into static data are fine, too, but will > generate this > error message unless it is suppressed. (Use -mutrep to inhibit warning) > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:326:13: > Datatype wchar_t declared with inconsistent type: int > load file standard.lcd: Specification of wchar_t: arbitrary integral > type > /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h:355:22: > Datatype wint_t declared with inconsistent type: unsigned int > load file standard.lcd: Specification of wint_t: arbitrary integral type > /usr/include/stdio.h:88:19: Mutable abstract type fpos_t declared without > pointer indirection: _G_fpos_t (violates assignment semantics) > /usr/include/stdio.h:88:26: Datatype fpos_t declared with inconsistent type: > _G_fpos_t > load file standard.lcd: Specification of fpos_t: void * > /usr/include/stdio.h:142:25: Variable stdin declared with inconsistent type: > struct _IO_FILE * > load file standard.lcd: Specification of stdin: FILE * > /usr/include/stdio.h:143:25: Variable stdout declared with inconsistent > type: > struct _IO_FILE * > load file standard.lcd: Specification of stdout: FILE * > /usr/include/stdio.h:144:25: Variable stderr declared with inconsistent > type: > struct _IO_FILE * > load file standard.lcd: Specification of stderr: FILE * > test.c: (in function main) > test.c:5:4: Return value (type int) ignored: puts("Test...") > Result returned by function call is not used. If this is intended, > can cast > result to (void) to eliminate message. (Use -retvalint to inhibit > warning) > /usr/include/stdio.h:146: Variable stdin implemented by a macro > load file standard.lcd: Specification of stdin > /usr/include/stdio.h:147: Variable stdout implemented by a macro > load file standard.lcd: Specification of stdout > /usr/include/stdio.h:148: Variable stderr implemented by a macro > load file standard.lcd: Specification of stderr > /usr/include/stdio.h: (in macro getc) > /usr/include/stdio.h:447:30: Function _IO_getc expects arg 1 to be > _IO_FILE * > gets FILE *: _fp > Types are incompatible. (Use -type to inhibit warning) > /usr/include/stdio.h: (in macro putc) > /usr/include/stdio.h:489:40: Function _IO_putc expects arg 2 to be > _IO_FILE * > gets FILE *: _fp > > Finished checking --- 15 code warnings > > > Regards, > > August > > > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss From fusionfive at comhem.se Sun Nov 20 08:39:44 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <1132448632.5077.9.camel@akebono> References: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> <437DF69D.9060205@comhem.se> <1132448632.5077.9.camel@akebono> Message-ID: <43807CA0.6080806@comhem.se> Brian Quinlan wrote: > I run splint version 3.1.1 without a .splintrc file on Fedora Core 3 and > get the following output for your test.c file: > > > [brian@akebono tmp]$ splint test.c > Splint 3.1.1 --- 15 Jun 2004 > > test.c: (in function main) > test.c:5:5: Return value (type int) ignored: puts("Test...") > Result returned by function call is not used. If this is intended, can > cast > result to (void) to eliminate message. (Use -retvalint to inhibit > warning) > > Finished checking --- 1 code warning This is just a test file. I want to be able to check any file. > Could the -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include in your .splintrc > be causing a problem? Without it Splint reports it can't find stddef.h (see previous message in this thread). > Splint has its own built-in versions of the > standard headers (in standard.lcd, I think, but I'm open to correction > on that). OK, but how do I make Splint use its own versions? August From brian.quinlan at iolfree.ie Mon Nov 21 21:24:45 2005 From: brian.quinlan at iolfree.ie (Brian Quinlan) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <4382816d.4e5f.0@iolfree.ie> Sorry if this starts a new thread. I've got webmail problems. I won't bore you with details. Comments inline below. > -----Original Message----- > From: splint-discuss-bounces@cs.virginia.edu [mailto:splint-discuss- > bounces@cs.virginia.edu] On Behalf Of August Karlstrom > Sent: 20 November 2005 13:40 > To: Discussions about the Splint annotation-assisted static analysis > project > Subject: Re: [splint-discuss] Parse Errors on Ubuntu > > Brian Quinlan wrote: > > I run splint version 3.1.1 without a .splintrc file on Fedora Core 3 and > > get the following output for your test.c file: > > > > > > [brian@akebono tmp]$ splint test.c > > Splint 3.1.1 --- 15 Jun 2004 > > > > test.c: (in function main) > > test.c:5:5: Return value (type int) ignored: puts("Test...") > > Result returned by function call is not used. If this is intended, can > > cast > > result to (void) to eliminate message. (Use -retvalint to inhibit > > warning) > > > > Finished checking --- 1 code warning > > This is just a test file. I want to be able to check any file. > Hi August, If you want to be able to check any file, then as a first step, you'll need to be able to check simple files. No doubt, this is why your original mail contained the simple test.c file. There appears to be something difference between our setups. Mine is the default splint (v3.1.1) that comes with Fedora Core 3. I'm afraid I'm a bit mystified by your problem. A standard installation should just be producing the single warning shown above. Is there anything different about yours, apart from the fact that it's on Ubuntu? Has it been patched? > > Could the -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include in your .splintrc > > be causing a problem? > > Without it Splint reports it can't find stddef.h (see previous message > in this thread). > This appears to be because it can't find its own built-in version of stdio.h and therefore looks in /usr/include to get it. If you can figure out why it's not using built-in headers, then you'll probably have your solution. The manual probably describes this, but off the top of my head, I can't tell you where. > > Splint has its own built-in versions of the > > standard headers (in standard.lcd, I think, but I'm open to correction > > on that). > > OK, but how do I make Splint use its own versions? > It should just use them by default. When I ran splint on your file, it didn't require any information apart from the filename. Oddly enough, your splint does seem to be loading standard.lcd - the error messages refer to it. Bye, Brian > > August > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss *************************** ADVERTISEMENT ****************************** Get BT Broadband from only EUR15 per month! Enjoy always-on internet for less! Check it out at http://www.btireland.ie If you haven't already tried Broadband, the BT Broadband Roadshow is coming to a town near you! Experience the fun - for free! Check out the Roadshow schedule at http://www.btireland.ie/roadshow From fusionfive at comhem.se Mon Nov 21 22:57:50 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <4382816d.4e5f.0@iolfree.ie> References: <4382816d.4e5f.0@iolfree.ie> Message-ID: <4382973E.5010706@comhem.se> Brian Quinlan wrote: > If you want to be able to check any file, then as a first step, you'll need > to be able to check simple files. No doubt, this is why your original mail > contained the simple test.c file. Yes, of course. Think I misinterpreted your intention of including the output from Splint with the file `test.c', sorry. > There appears to be something difference > between our setups. Mine is the default splint (v3.1.1) that comes with > Fedora Core 3. I'm afraid I'm a bit mystified by your problem. A standard > installation should just be producing the single warning shown above. Is > there anything different about yours, apart from the fact that it's on > Ubuntu? Has it been patched? I too used Fedora Core 3 some year ago (then FC4, then Ubuntu Hoare and now Ubuntu Breezy) and then I had no problems. In Ubuntu Breezy I use the standard version (3.1.1-4) of Splint, downloaded and installed with the package manager Synaptic. Maybe I should contact the Ubuntu/Debian repository manager of this package. >>OK, but how do I make Splint use its own versions? > > It should just use them by default. When I ran splint on your file, it > didn't require any information apart from the filename. Oddly enough, your > splint does seem to be loading standard.lcd - the error messages refer to > it. I played around with various "use system headers" options but I couldn't get it to work. Anyway, thanks for your help. August From ptp at lysator.liu.se Thu Nov 24 06:40:48 2005 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <4382973E.5010706@comhem.se> References: <4382816d.4e5f.0@iolfree.ie> <4382973E.5010706@comhem.se> Message-ID: <20051124114048.GV18398@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> On Tue, Nov 22, 2005 at 04:57:50AM +0100, August Karlstrom wrote: > >>OK, but how do I make Splint use its own versions? > > > >It should just use them by default. When I ran splint on your file, it > >didn't require any information apart from the filename. Oddly enough, your > >splint does seem to be loading standard.lcd - the error messages refer to > >it. > > I played around with various "use system headers" options but I couldn't > get it to work. I don't know if this helps at all, but this is from the README.Debian: added an example/env.sh to append to your environment to make splint work correctly and example/env.sh: export LARCH_PATH=/usr/share/splint/lib/ export LCLIMPORTDIR=/usr/share/splint/imports/ -- Tommy Pettersson From ptp at lysator.liu.se Thu Nov 24 06:40:48 2005 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <4382973E.5010706@comhem.se> References: <4382816d.4e5f.0@iolfree.ie> <4382973E.5010706@comhem.se> Message-ID: <20051124114048.GV18398@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> On Tue, Nov 22, 2005 at 04:57:50AM +0100, August Karlstrom wrote: > >>OK, but how do I make Splint use its own versions? > > > >It should just use them by default. When I ran splint on your file, it > >didn't require any information apart from the filename. Oddly enough, your > >splint does seem to be loading standard.lcd - the error messages refer to > >it. > > I played around with various "use system headers" options but I couldn't > get it to work. I don't know if this helps at all, but this is from the README.Debian: added an example/env.sh to append to your environment to make splint work correctly and example/env.sh: export LARCH_PATH=/usr/share/splint/lib/ export LCLIMPORTDIR=/usr/share/splint/imports/ -- Tommy Pettersson From fusionfive at comhem.se Thu Nov 24 15:00:37 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:18 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <20051124114048.GV18398@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> References: <4382816d.4e5f.0@iolfree.ie> <4382973E.5010706@comhem.se> <20051124114048.GV18398@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> Message-ID: <43861BE5.3050303@comhem.se> Tommy Pettersson wrote: > I don't know if this helps at all, but this is from the README.Debian: > > added an example/env.sh to append to your environment > to make splint work correctly > > and example/env.sh: > > export LARCH_PATH=/usr/share/splint/lib/ > export LCLIMPORTDIR=/usr/share/splint/imports/ > > Unfortunately it doesn't seem to work. $ export LARCH_PATH=/usr/share/splint/lib/ $ export LCLIMPORTDIR=/usr/share/splint/imports/ $ cat test.c #include int main(void) { puts("Hello there"); return 0; } $ cat ~/.splintrc # -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include # -mut-rep # -incondefs # Splint doesn't recognize GCC's __builtin_va_list type. # -D__builtin_va_list=va_list $ splint test.c Splint 3.1.1 --- 13 Aug 2004 /usr/include/stdio.h:34:21: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include Preprocessing error. (Use -preproc to inhibit warning) In file included from test.c:1 /usr/include/bits/types.h:31:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/stdio.h:36, from test.c:1 /usr/include/_G_config.h:14:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/_G_config.h:24, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/gconv.h:28, from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/gconv.h:31:20: Cannot find include file stddef.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/libio.h:53:21: Cannot find include file stdarg.h on search path: .;/home/august/include;/usr/include;/usr/include In file included from /usr/include/stdio.h:72, from test.c:1 Preprocessing error for file: /home/august/eget/prog/c/test/test.c *** Cannot continue. August From ptp at lysator.liu.se Fri Nov 25 04:12:04 2005 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <437DF69D.9060205@comhem.se> References: <11352F9641010A418AD5057945A3A6590739A5@MTV-EXCHANGE.microfocus.com> <437DF69D.9060205@comhem.se> Message-ID: <20051125091204.GA25796@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> On Fri, Nov 18, 2005 at 04:43:25PM +0100, August Karlstrom wrote: > The setting did work when I first tried it, but now I get the same > errors as before, I don't get it. Just to check all possibilities: you don't have any strange settings in $HOME/.splintrc? -- Tommy Pettersson From Michael.Wojcik at MicroFocus.com Fri Nov 25 13:26:03 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <11352F9641010A418AD5057945A3A6591F11EA@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > August Karlstrom > Sent: Thursday, 24 November, 2005 15:01 > /usr/include/stdio.h:34:21: Cannot find include file stddef.h > on search path: > > .;/home/august/include;/usr/include;/usr/include Since stddef.h is a standard header, I'd try fixing this first. If splint can't find a standard header, then its configuration has to be missing an include directory that's in the implementation's default set (because a conforming implementation, even a freestanding one, has to provide stddef.h). On my Linux system here, stddef.h is in /usr/include/linux, so I'd put a -I/usr/include/linux in .splintrc. There seems to be some other problem with splint's handling of #include here, though, because your .splintrc contains: -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include yet that doesn't appear in the search path splint lists in the error message above. Still, I'd definitely fix whatever is preventing splint from finding stddef.h before I tried to tackle anything else. That's a serious failure. -- Michael Wojcik Principal Software Systems Developer, Micro Focus From ptp at lysator.liu.se Fri Nov 25 14:34:08 2005 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <11352F9641010A418AD5057945A3A6591F11EA@MTV-EXCHANGE.microfocus.com> References: <11352F9641010A418AD5057945A3A6591F11EA@MTV-EXCHANGE.microfocus.com> Message-ID: <20051125193408.GB25796@812165098-VISIT-ADSL-LKOPING-NET.host.songnetworks.se> On Fri, Nov 25, 2005 at 10:26:03AM -0800, Michael Wojcik wrote: > > From: splint-discuss-bounces@cs.virginia.edu > > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > > August Karlstrom > > Sent: Thursday, 24 November, 2005 15:01 > > > /usr/include/stdio.h:34:21: Cannot find include file stddef.h > > on search path: > > > > .;/home/august/include;/usr/include;/usr/include > > Still, I'd definitely fix whatever is preventing splint from finding > stddef.h before I tried to tackle anything else. That's a serious > failure. I'm not so sure this is the way to go. stddef.h is included from stdio.h, and splint should _not_ include stdio.h in the first place since it's a system header file. If I for example run 'splint -systemdirs /tmp test.c' I too get: Splint 3.1.1.2 --- 20 May 2005 /usr/include/stdio.h:34: Cannot find include file stddef.h on search path: /usr/include;/usr/include Preprocessing error. (Use -preproc to inhibit warning) In file included from test.c:1 /usr/include/bits/types.h:31: Cannot find include file stddef.h on search path: /usr/include;/usr/include In file included from /usr/include/stdio.h:36, from test.c:1 /usr/include/_G_config.h:14: Cannot find include file stddef.h on search path: /usr/include;/usr/include In file included from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48: Cannot find include file stddef.h on search path: /usr/include;/usr/include In file included from /usr/include/_G_config.h:24, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/wchar.h:48: Cannot find include file stddef.h on search path: /usr/include;/usr/include In file included from /usr/include/gconv.h:28, from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/gconv.h:31: Cannot find include file stddef.h on search path: /usr/include;/usr/include In file included from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from test.c:1 /usr/include/libio.h:53: Cannot find include file stdarg.h on search path: /usr/include;/usr/include In file included from /usr/include/stdio.h:72, from test.c:1 Preprocessing error for file: /home/tommy/tmp/test.c *** Cannot continue. all because splint now thinks /usr/include/stdio.h is some project file it should check. -- Tommy Pettersson From Michael.Wojcik at MicroFocus.com Mon Nov 28 09:55:18 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <11352F9641010A418AD5057945A3A6591F11F4@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > Tommy Pettersson > Sent: Friday, 25 November, 2005 14:34 > > > On Fri, Nov 25, 2005 at 10:26:03AM -0800, Michael Wojcik wrote: > > > From: splint-discuss-bounces@cs.virginia.edu > > > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > > > August Karlstrom > > > Sent: Thursday, 24 November, 2005 15:01 > > > > > /usr/include/stdio.h:34:21: Cannot find include file stddef.h > > > on search path: > > > > > > .;/home/august/include;/usr/include;/usr/include > > > > Still, I'd definitely fix whatever is preventing splint from finding > > stddef.h before I tried to tackle anything else. That's a serious > > failure. > > I'm not so sure this is the way to go. stddef.h is included > from stdio.h, and splint should _not_ include stdio.h in the > first place since it's a system header file. Right, right. After checking the splint manual again (tough, because "-systemdirs" is an undocumented alias for "-sysdirs", and "-sysdirs" is documented but most of the documentation appears only under "sys-dirs" for some reason), I believe the problem is that splint doesn't have a complete list of all the directories containing ISO-standard headers. (The same is probably true for POSIX-standard headers.) So, probably what August needs is a -sysdirs option on the command line, or the .splintrc equivalent, specifying all the directories where ISO-standard (and maybe POSIX-standard) headers are to be found. Since stddef.h is in /usr/include/linux, I'd start with something like: -sysdirs /usr/include:/usr/include/sys:/usr/include/linux and see how things went from there. -- Michael Wojcik Principal Software Systems Developer, Micro Focus From fusionfive at comhem.se Mon Nov 28 11:35:01 2005 From: fusionfive at comhem.se (August Karlstrom) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu In-Reply-To: <436E9027.1050205@comhem.se> References: <436E9027.1050205@comhem.se> Message-ID: <438B31B5.4080202@comhem.se> Hi, I found the cause of the problem. My `~/.gnomerc' contained the line export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/include which expands to `:/home/august/include'. I changed the line above to export C_INCLUDE_PATH=$HOME/include and now Splint works as expected. Is a leading colon in a path list invalid path list syntax? Thank you all for your suggestions. Regards, August From Michael.Wojcik at MicroFocus.com Mon Nov 28 17:37:33 2005 From: Michael.Wojcik at MicroFocus.com (Michael Wojcik) Date: Wed Mar 22 17:11:19 2006 Subject: [splint-discuss] Parse Errors on Ubuntu Message-ID: <11352F9641010A418AD5057945A3A6591F1203@MTV-EXCHANGE.microfocus.com> > From: splint-discuss-bounces@cs.virginia.edu > [mailto:splint-discuss-bounces@cs.virginia.edu] On Behalf Of > August Karlstrom > Sent: Monday, 28 November, 2005 11:35 > > I found the cause of the problem. My `~/.gnomerc' contained the line > > export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/include > > which expands to `:/home/august/include'. I changed the line above to > > export C_INCLUDE_PATH=$HOME/include > > and now Splint works as expected. Is a leading colon in a path list > invalid path list syntax? That depends on what's parsing it. In most shells, I belive an empty pathname (whether it appears at the front of the list or elsewhere) is treated identically to "." - which makes sense, because it's in effect an empty relative path, so the empty string is appended to the name of the current directory. However, I haven't looked at how Splint parses path lists, and for that matter I don't know why it's looking at $C_INCLUDE_PATH at all, since it's not mentioned in the documentation. -- Michael Wojcik Principal Software Systems Developer, Micro Focus