From minal.sharma at st.com Wed Mar 2 07:09:44 2005
From: minal.sharma at st.com (Minal SHARMA)
Date: Wed Mar 22 17:10:51 2006
Subject: [splint-discuss] Parse error coming due to EXPORT_SYMBOL
Message-ID: <000101c51f20$b912f8d0$c60ab40a@dlh.st.com>
Hi
PLz reply if any one know hot to remove parse error coming due to EXPORT_SYMBOL as defined inside ( linux/module.h).
I have tried by using the -D__GENKSYMS__ and permutation and combination of these :
#-DEXPORT_SYMTAB
#-D__alpha__
#-DAUTOCONF_INCLUDED
#-DCONFIG_DEVPTS_FS_MODULE
#-DBUILDING_PTY_C
#-DCONFIG_VT
#-DEXPORT_SYMBOL(var)
but still it is coming.
From brian.quinlan at iolfree.ie Wed Mar 2 08:42:38 2005
From: brian.quinlan at iolfree.ie (Brian Quinlan)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Parse error coming due to EXPORT_SYMBOL
In-Reply-To: <000101c51f20$b912f8d0$c60ab40a@dlh.st.com>
References: <000101c51f20$b912f8d0$c60ab40a@dlh.st.com>
Message-ID: <1109770957.17949.21.camel@dub1-odcl4>
Hi Minal,
You'll have to redefine the EXPORT_SYMBOL to be something that splint
understands (but make sure that the definition for gcc stays the same).
This can be done on the splint command-line. An example is the
redefinition of asm in SPLINT_FLAGS in the makefile here:
http://www.splint.org/pipermail/splint-discuss/2005-January/000528.html
Or you can do it via a "helper" header file (SplintLinuxKernelHelper.h
as described in more detail in the post referenced above).
Bye,
Brian
On Wed, 2005-03-02 at 12:09, Minal SHARMA wrote:
> Hi
>
>
> PLz reply if any one know hot to remove parse error coming due to EXPORT_SYMBOL as defined inside ( linux/module.h).
> I have tried by using the -D__GENKSYMS__ and permutation and combination of these :
> #-DEXPORT_SYMTAB
> #-D__alpha__
> #-DAUTOCONF_INCLUDED
> #-DCONFIG_DEVPTS_FS_MODULE
> #-DBUILDING_PTY_C
> #-DCONFIG_VT
> #-DEXPORT_SYMBOL(var)
>
> but still it is coming.
>
>
>
> _______________________________________________
> splint-discuss mailing list
> splint-discuss@cs.virginia.edu
> http://www.splint.org/mailman/listinfo/splint-discuss
From karsten.klein at rawe.de Thu Mar 10 02:54:44 2005
From: karsten.klein at rawe.de (Karsten Klein)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Warning: something not completely defined
Message-ID: <422FFD44.1080302@rawe.de>
Hi,
does anybody know what SPLINT thinks what is wrong on the follwing code:
I am using Imagecraft ICCAVR compiler 7.00A and Splint 3.1.1 --- 12
April 2003 (win32)
The code works fine on a simulator and on the target as well (Atmega 32
from Atmel).
Thank you in advance.
Regards Karsten
Include -File kss.h:
////////////////////////////////////////////////////////////////////////////////////////////
.....
struct str_kss
{
unsigned char fehler;
unsigned int parameter;
}; struct str_kss kss;
// Prototyps:
const char * KssGetFehlermeldung (void);
const char kss_fehler01[] = "Parameter: fehlt"; const char
kss_fehler02[] = "Parameter: nicht erfolderlich";
const char kss_fehler03[] = "Parameter: Anzahl > 1"; const char
kss_fehler04[] = "Parameter: zu klein";
const char kss_fehler05[] = "Parameter: zu gross";
const char kss_fehler06[] = "Parameter: Syntaxerror";
const char kss_fehler07[] = "Parameter: zu viele Ziffern";
const char kss_fehler08[] = "Unbekanntes Komando";
#define KSS_ANZ_FEHLER (unsigned char)8
const char * kss_err_ptr[KSS_ANZ_FEHLER] =
{
kss_fehler01, kss_fehler02, kss_fehler03, kss_fehler04,
kss_fehler05, kss_fehler06, kss_fehler07, kss_fehler08
};
.........................
_______________________________________________________________________________________________
Source_File kss.c:
////////////////////////////////////////////////////////////////////////////////////////////
#include "kss.h"
const char * KssGetFehlermeldung(void)
{
const char * ptr;
unsigned char nr;
nr = kss.fehler-(unsigned char)1;
ptr = kss_err_ptr[nr];
return ( ptr );
}
..............................................
_____________ SPLINT Output___________________________________
P:\Temp\Software\V0_1_02\kss.c: (in function KssGetFehlermeldung)
P:\Temp\Software\V0_1_02\kss.c(100,17):
Function returns with global kss_err_ptr not completely defined
(kss_err_ptr[] is undefined)
Storage derivable from a parameter, return value or global is not defined.
Use /*@out@*/ to denote passed or returned storage which need not be
defined.
(Use -compdef to inhibit warning)
P:\Temp\Software\V0_1_02\kss.c(100,9):
Storage kss_err_ptr[] possibly released
_______________________________________________________________
This message was scanned by Trend Micro Anti-Virus.
From rb at ravenbrook.com Thu Mar 10 08:53:48 2005
From: rb at ravenbrook.com (Richard Brooksby)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Considering using splint on the MPS project
Message-ID: <6c016673485cc803b79554e614de993c@ravenbrook.com>
Hello everyone.
This is a note to say that we're considering using splint for the
Memory Pool System (MPS) project
. The MPS is a high-integrity
memory manager that we developed over many years using rigorous
software inspection techniques. We considered using LCLint years ago,
but it was too buggy at the time. We're now firing up the project
again and looking at splint.
So, I'm evaluating whether it's worth using splint. I have a question.
I applied splint to our code in a fairly na?ve manner:
> splint -weak -booltype Bool -I. -DCONFIG_VAR_CI -DCONFIG_PROD_MPS
> -DCONFIG_PF_XCPPGC mpsi.c mpm.c arenavm.c arenacl.c arena.c global.c
> locus.c tract.c walk.c reserv.c protocol.c pool.c
> poolabs.c trace.c root.c seg.c format.c buffer.c ref.c
> bt.c ring.c shield.c ld.c event.c sac.c message.c
> poolmrg.c poolmfs.c poolmv.c dbgpool.c dbgpooli.c
> boot.c meter.c splay.c cbs.c version.c
This produces two useful and interesting warnings, but a _lot_ of
warnings about "Bool", "TRUE", and "FALSE", like this one:
> mpm.c:78:10: Return value type enum { FALSE, TRUE } does not match
> declared
> type Bool: TRUE
We say (in misc.h):
> typedef int Bool; /* */
> enum {
> FALSE = 0,
> TRUE = 1
> };
because we have a quality rule against "typedef enum" (because you
can't predict the width of the integral type returned and therefore
can't use it in portable binary interfaces).
Skimming and searching the splint manual I can't find any way to
educate splint that "TRUE" and "FALSE" are members of the "Bool" type.
Can someone point me in the right direction?
I realize we could probably make typedef enum Bool inside a #ifdef
SPLINT block or similar, but we also have strict quality rules against
sprinkling our code with #ifdefs, and I would really like to avoid
that.
Thanks,
Richard.
---
Richard Brooksby Senior Consultant
Ravenbrook Limited
Voice: +44 777 9996245 Fax: +44 870 1641432
AIM: hothquist Yahoo: gresque Jabber: hothquist@jabber.org
LinkedIn:
From stephane.martin at ca.kontron.com Thu Mar 10 09:13:55 2005
From: stephane.martin at ca.kontron.com (=?iso-8859-1?Q?=22Martin=2C_St=E9phane=22?=)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Considering using splint on the MPS project
Message-ID: <5009AD9521A8D41198EE00805F85F18F06372C5F@sembo111.teknor.com>
Hi,
For Splint config: Check section 4.2 of the manual about config flag
-booltype and set
-booltype bool
For your compiler: Set
#define FALSE 0
#define TRUE (!FALSE)
/* bool is a keyword in C++ */
/*@-cppnames@*/
typedef unsigned char bool;
typedef bool your_prefered_boot_type_name;
/*@=cppnames@*/
and about your enum comment, I verry verry verry agree with you, we got a
lot of problem with emum length!!!!
-------------------------------------------------------------
Stephane Martin, ing. Kontron Canada
Low Level Software Engineer 616 Cure-Boivin
Tel (450) 437-4661 ext: 2349 Boisbriand, Quebec
Fax (450) 437-8053 Canada, J7G 2A7
mailto:stephane.martin@ca.kontron.com http://www.kontron.com
-----Message d'origine-----
De : Richard Brooksby [mailto:rb@ravenbrook.com]
Envoy? : 10 mars, 2005 08:54
? : splint-discuss@cs.virginia.edu
Cc : MPS Project Staff Mailing List
Objet : [splint-discuss] Considering using splint on the MPS project
Hello everyone.
This is a note to say that we're considering using splint for the
Memory Pool System (MPS) project
. The MPS is a high-integrity
memory manager that we developed over many years using rigorous
software inspection techniques. We considered using LCLint years ago,
but it was too buggy at the time. We're now firing up the project
again and looking at splint.
So, I'm evaluating whether it's worth using splint. I have a question.
I applied splint to our code in a fairly na?ve manner:
> splint -weak -booltype Bool -I. -DCONFIG_VAR_CI -DCONFIG_PROD_MPS
> -DCONFIG_PF_XCPPGC mpsi.c mpm.c arenavm.c arenacl.c arena.c global.c
> locus.c tract.c walk.c reserv.c protocol.c pool.c
> poolabs.c trace.c root.c seg.c format.c buffer.c ref.c
> bt.c ring.c shield.c ld.c event.c sac.c message.c
> poolmrg.c poolmfs.c poolmv.c dbgpool.c dbgpooli.c
> boot.c meter.c splay.c cbs.c version.c
This produces two useful and interesting warnings, but a _lot_ of
warnings about "Bool", "TRUE", and "FALSE", like this one:
> mpm.c:78:10: Return value type enum { FALSE, TRUE } does not match
> declared
> type Bool: TRUE
We say (in misc.h):
> typedef int Bool; /* */
> enum {
> FALSE = 0,
> TRUE = 1
> };
because we have a quality rule against "typedef enum" (because you
can't predict the width of the integral type returned and therefore
can't use it in portable binary interfaces).
Skimming and searching the splint manual I can't find any way to
educate splint that "TRUE" and "FALSE" are members of the "Bool" type.
Can someone point me in the right direction?
I realize we could probably make typedef enum Bool inside a #ifdef
SPLINT block or similar, but we also have strict quality rules against
sprinkling our code with #ifdefs, and I would really like to avoid
that.
Thanks,
Richard.
---
Richard Brooksby Senior Consultant
Ravenbrook Limited
Voice: +44 777 9996245 Fax: +44 870 1641432
AIM: hothquist Yahoo: gresque Jabber: hothquist@jabber.org
LinkedIn:
_______________________________________________
splint-discuss mailing list
splint-discuss@cs.virginia.edu
http://www.splint.org/mailman/listinfo/splint-discuss
From rb at ravenbrook.com Thu Mar 10 09:25:32 2005
From: rb at ravenbrook.com (Richard Brooksby)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Considering using splint on the MPS project
In-Reply-To: <5009AD9521A8D41198EE00805F85F18F06372C5F@sembo111.teknor.com>
References: <5009AD9521A8D41198EE00805F85F18F06372C5F@sembo111.teknor.com>
Message-ID: <4f3d89890e34d5fe50af1158cea11c13@ravenbrook.com>
On 10 Mar 2005, at 14:13, Martin, St?phane wrote:
> For Splint config: Check section 4.2 of the manual about config flag
> -booltype and set
> -booltype bool
>
> For your compiler: Set
> #define FALSE 0
> #define TRUE (!FALSE)
>
> /* bool is a keyword in C++ */
> /*@-cppnames@*/
> typedef unsigned char bool;
> typedef bool your_prefered_boot_type_name;
> /*@=cppnames@*/
>
> and about your enum comment, I verry verry verry agree with you, we
> got a
> lot of problem with emum length!!!!
Thank you Stephane.
However, perhaps I was not clear. We do not want to modify our code in
order to make splint check it correctly. We want to tell splint how to
check our code. So is there a way to tell splint to check our current
Boolean type?
It's not just booleans either: we have other integral types which may
only have enum constants as members, but which are not typedef enum.
We want them checked too. Boolean is not very much of a special case.
Thanks,
Richard.
---
Richard Brooksby Senior Consultant
Ravenbrook Limited
Voice: +44 777 9996245 Fax: +44 870 1641432
AIM: hothquist Yahoo: gresque Jabber: hothquist@jabber.org
LinkedIn:
From stephane.martin at ca.kontron.com Thu Mar 10 09:57:25 2005
From: stephane.martin at ca.kontron.com (=?iso-8859-1?Q?=22Martin=2C_St=E9phane=22?=)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Considering using splint on the MPS project
Message-ID: <5009AD9521A8D41198EE00805F85F18F06372C8B@sembo111.teknor.com>
This setting use usual boolean way with the type bool and the symbol TRUE
and FALSE.
If you use something else for boolean you can use the Splint flag -booltype
to instruct Splint about your own boolean type. If you want new symbol for
true or false there is also additional Splint config flag to instruct Splint
about your new boolean symbol.
Hope this help you, can't tell you more, this is the way we use it!!!
-------------------------------------------------------------
Stephane Martin, ing. Kontron Canada
Low Level Software Engineer 616 Cure-Boivin
Tel (450) 437-4661 ext: 2349 Boisbriand, Quebec
Fax (450) 437-8053 Canada, J7G 2A7
mailto:stephane.martin@ca.kontron.com http://www.kontron.com
-----Message d'origine-----
De : Richard Brooksby [mailto:rb@ravenbrook.com]
Envoy? : 10 mars, 2005 09:26
? : Discussions about the Splint annotation-assisted static analysis
project
Cc : MPS Project Staff Mailing List
Objet : Re: [splint-discuss] Considering using splint on the MPS project
On 10 Mar 2005, at 14:13, Martin, St?phane wrote:
> For Splint config: Check section 4.2 of the manual about config flag
> -booltype and set
> -booltype bool
>
> For your compiler: Set
> #define FALSE 0
> #define TRUE (!FALSE)
>
> /* bool is a keyword in C++ */
> /*@-cppnames@*/
> typedef unsigned char bool;
> typedef bool your_prefered_boot_type_name;
> /*@=cppnames@*/
>
> and about your enum comment, I verry verry verry agree with you, we
> got a
> lot of problem with emum length!!!!
Thank you Stephane.
However, perhaps I was not clear. We do not want to modify our code in
order to make splint check it correctly. We want to tell splint how to
check our code. So is there a way to tell splint to check our current
Boolean type?
It's not just booleans either: we have other integral types which may
only have enum constants as members, but which are not typedef enum.
We want them checked too. Boolean is not very much of a special case.
Thanks,
Richard.
---
Richard Brooksby Senior Consultant
Ravenbrook Limited
Voice: +44 777 9996245 Fax: +44 870 1641432
AIM: hothquist Yahoo: gresque Jabber: hothquist@jabber.org
LinkedIn:
_______________________________________________
splint-discuss mailing list
splint-discuss@cs.virginia.edu
http://www.splint.org/mailman/listinfo/splint-discuss
From Jay.St.Pierre at Colorado.EDU Thu Mar 10 12:55:24 2005
From: Jay.St.Pierre at Colorado.EDU (Jay A. St. Pierre)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] Considering using splint on the MPS project
In-Reply-To: <6c016673485cc803b79554e614de993c@ravenbrook.com>
Message-ID:
On Thu, 10 Mar 2005, Richard Brooksby wrote:
> I applied splint to our code in a fairly na?ve manner:
>
> > splint -weak -booltype Bool -I. -DCONFIG_VAR_CI -DCONFIG_PROD_MPS
> > -DCONFIG_PF_XCPPGC mpsi.c mpm.c arenavm.c arenacl.c arena.c global.c
> > locus.c tract.c walk.c reserv.c protocol.c pool.c
> > poolabs.c trace.c root.c seg.c format.c buffer.c ref.c
> > bt.c ring.c shield.c ld.c event.c sac.c message.c
> > poolmrg.c poolmfs.c poolmv.c dbgpool.c dbgpooli.c
> > boot.c meter.c splay.c cbs.c version.c
>
> This produces two useful and interesting warnings, but a _lot_ of
> warnings about "Bool", "TRUE", and "FALSE", like this one:
>
> > mpm.c:78:10: Return value type enum { FALSE, TRUE } does not match
> > declared
> > type Bool: TRUE
>
> We say (in misc.h):
>
> > typedef int Bool; /* */
> > enum {
> > FALSE = 0,
> > TRUE = 1
> > };
>
> because we have a quality rule against "typedef enum" (because you
> can't predict the width of the integral type returned and therefore
> can't use it in portable binary interfaces).
>
> Skimming and searching the splint manual I can't find any way to
> educate splint that "TRUE" and "FALSE" are members of the "Bool" type.
> Can someone point me in the right direction?
>
> I realize we could probably make typedef enum Bool inside a #ifdef
> SPLINT block or similar, but we also have strict quality rules against
> sprinkling our code with #ifdefs, and I would really like to avoid
> that.
Perhaps you could do this:
typedef int Bool;
#define FALSE ((Bool) 0)
#define TRUE ((Bool) 1)
-Jay
From rb at ravenbrook.com Thu Mar 10 14:05:19 2005
From: rb at ravenbrook.com (Richard Brooksby)
Date: Wed Mar 22 17:10:52 2006
Subject: [splint-discuss] splint doesn't seem to understand numeric rules
Message-ID: <864ac028036caf3adc46d70cf0dc6283@ravenbrook.com>
I'm making some progress in getting our sources past "splint -weak".
Splint has found us one potential bug, which could occur in rare
circumstances, so that's already useful.
However, I'm having trouble with numeric expressions like this:
The lines in question say:
return chain->gens[0].capacity * 1024.0
- (double)GenDescNewSize(&chain->gens[0]);
This expression is definitely a double, but splint seems to think it's
an unsigned integer.
> locus.c:252:12: Return value type unsigned long int does not match
> declared
> type double: chain->gens[0].capacity * 1024.0 -
> (double)GenDescNewSize(&chai
> n->gens[0])
Is this a known problem?
From jfischoff at topfloorstudio.com Thu Mar 10 20:27:24 2005
From: jfischoff at topfloorstudio.com (Jonathan Fischoff)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] restricting warning messages
Message-ID:
I would like to receive message that that are caused by using the flags
+imp-checked-strict-statics and +imp-checked-strict-globs. Is there a way
for me to do that?
-Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20050310/3b88d6ad/attachment.htm
From rb at ravenbrook.com Mon Mar 14 10:55:08 2005
From: rb at ravenbrook.com (Richard Brooksby)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] splint doesn't seem to understand numeric rules
In-Reply-To: <864ac028036caf3adc46d70cf0dc6283@ravenbrook.com>
References: <864ac028036caf3adc46d70cf0dc6283@ravenbrook.com>
Message-ID:
Running "splint -weak" on the attached C produces a set of warnings
that are at the very least inconsistent, and I believe incorrect:
> Splint 3.1.1 --- 10 Mar 2005
>
> double.c: (in function bar1)
> double.c:3:12: Return value type long int does not match declared type
> double:
> ((long int)1) * 1.0
> To allow all numeric types to match, use +relaxtypes.
> double.c: (in function bar3)
> double.c:13:12: Return value type unsigned long int does not match
> declared
> type double: ((unsigned long int)1) * 1.0
> double.c: (in function bar5)
> double.c:23:12: Return value type long int does not match declared
> type double:
> 1l * 1.0
It seems that splint believes that long * double is long, when I think
it should be double, and also that unsigned long * double is unsigned
long.
C99 ?6.3.1.8 ?1 seems to agree with me:
> Otherwise, if the corresponding real type of either operand isdouble,
> the other operand is converted, without change of type domain, to a
> type whose corresponding real type is double.
and this comes before the integer promotions. Virtually the same text
appears in C89 ?6.2.1.5.
Thanks!
-------------- next part --------------
double bar1(void)
{
return ((long)1) * 1.0;
}
double bar2(void)
{
return ((unsigned)1) * 1.0;
}
double bar3(void)
{
return ((unsigned long)1) * 1.0;
}
double bar4(void)
{
return ((int)1) * 1.0;
}
double bar5(void)
{
return 1l * 1.0;
}
double bar6(void)
{
return 1u * 1.0;
}
-------------- next part --------------
For background, here's the thread from the splint-discuss mailing list.
On 10 Mar 2005, at 19:05, Richard Brooksby wrote:
> I'm making some progress in getting our sources past "splint -weak".
> Splint has found us one potential bug, which could occur in rare
> circumstances, so that's already useful.
>
> However, I'm having trouble with numeric expressions like this:
>
> The lines in question say:
>
> return chain->gens[0].capacity * 1024.0
> - (double)GenDescNewSize(&chain->gens[0]);
>
> This expression is definitely a double, but splint seems to think it's
> an unsigned integer.
>
>> locus.c:252:12: Return value type unsigned long int does not match
>> declared
>> type double: chain->gens[0].capacity * 1024.0 -
>> (double)GenDescNewSize(&chai
>> n->gens[0])
>
> Is this a known problem?
>
> _______________________________________________
> splint-discuss mailing list
> splint-discuss@cs.virginia.edu
> http://www.splint.org/mailman/listinfo/splint-discuss
From bclum at cs.ucsd.edu Mon Mar 14 15:37:39 2005
From: bclum at cs.ucsd.edu (Brian C. Lum)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] not completely defined error
Message-ID: <60237.24.165.15.134.1110832659.squirrel@acs-webmail.ucsd.edu>
I am receiving an error about passed storage not completely defined.
This is about all I do with my char array, and as you can tell, both
arrays are defined.
static int foo(/*@in@*/ char*, /*@in@*/ char*, int);
int n;
char *v = (char *) malloc(n*sizeof(char));
char *w = (char *) malloc(n*sizeof(char));
for(i=0; i
Message-ID: <423613C1.9772E96C@yahoo.com>
"Brian C. Lum" wrote:
>
> I am receiving an error about passed storage not completely defined.
>
> This is about all I do with my char array, and as you can tell, both
> arrays are defined.
>
> static int foo(/*@in@*/ char*, /*@in@*/ char*, int);
>
> int n;
> char *v = (char *) malloc(n*sizeof(char));
> char *w = (char *) malloc(n*sizeof(char));
I don't know about your error messages, but the above should read
simply:
char *v = malloc(n);
char *w = malloc(n);
The casts do nothing but conceal possible errors, and sizeof(char)
is one by definition. If you want to allow for future changes in
the types of v and w then use:
char *v = malloc(n * sizeof *v);
char *w = malloc(n * sizeof *w);
All casts are suspect.
BTW the storage is defined, but the contents of that storage are
uninitialized, which may be what splint is complaining about.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
From bclum at cs.ucsd.edu Tue Mar 15 15:41:45 2005
From: bclum at cs.ucsd.edu (Brian C. Lum)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] parse errors
Message-ID: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
I am trying to run splint on a project that I have written. There are
multiple files that use each other's C functions. They are all in the
same directory. Unfortunately, I get a parsing error when it reaches a
line with a function/struct defined in another C file.
I run splint with
splint +posixlib -I/home/bclum/test/proj1/ *.c
Can anyone suggest what I am doing wrong?
With thanks,
Brian
From roland.illig at gmx.de Tue Mar 15 16:50:07 2005
From: roland.illig at gmx.de (Roland Illig)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] parse errors
In-Reply-To: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
References: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
Message-ID: <4237588F.8070601@gmx.de>
Brian C. Lum wrote:
> I am trying to run splint on a project that I have written. There are
> multiple files that use each other's C functions. They are all in the
> same directory. Unfortunately, I get a parsing error when it reaches a
> line with a function/struct defined in another C file.
>
> I run splint with
>
> splint +posixlib -I/home/bclum/test/proj1/ *.c
>
> Can anyone suggest what I am doing wrong?
The most likely reason for this is that your code does not follow the
POSIX interface (or that SPlint has not yet integrated the definitions
for that function/struct).
Some files like , , are not included as the normal C
preprocessor would do, but are replaced by the SPlint definitions
library, which defines some functions and structs differently.
You should post a few lines around the point where the parse error
occurs. Then we can help you further.
Or you check out which functions are defined in the POSIX standard:
http://www.opengroup.org/onlinepubs/009695399/nfindex.html
Roland
From bclum at cs.ucsd.edu Tue Mar 15 17:53:24 2005
From: bclum at cs.ucsd.edu (Brian C. Lum)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] parse errors
In-Reply-To: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
References: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
Message-ID: <2182.132.239.10.206.1110927204.squirrel@acs-webmail.ucsd.edu>
I should be more specific about my code. We have a bunch of posixlib
files included as well as our own files.
The project is a HTTP Server. request.c takes a struct called
HttpRequest, which goes to convert which makes a HttpResponse. In
response.h, we defined the struct called HttpResponse. I get a parse
error in content when I reach a line with anything we included ourselves.
I get a parse error:
------------------------------------------------------------------------
Splint 3.1.1 --- 06 Jun 2003
convert.c:45:17: Parse Error. (For help on parse errors, see splint -help
parseerrors.)
*** Cannot continue.
------------------------------------------------------------------------
convert.c has the following:
#include
#include
#include
#include
#include
#include
#include
#include "request.h"
#include "response.h"
#include "convert.h"
#include "content.h"
.
.
.
Line 45: HttpResponse* response = (HttpResponse *)
malloc(sizeof(HttpResponse));
Http Request from request.h is just:
typedef struct HttpRequest
{
int type;
int httpVersion;
char* objectName;
char* hostName;
int connection;
} HttpRequest;
Does anyone have any suggestions?
With thanks,
Brian
> I am trying to run splint on a project that I have written. There are
> multiple files that use each other's C functions. They are all in the
> same directory. Unfortunately, I get a parsing error when it reaches a
> line with a function/struct defined in another C file.
>
> I run splint with
>
> splint +posixlib -I/home/bclum/test/proj1/ *.c
>
> Can anyone suggest what I am doing wrong?
>
> With thanks,
> Brian
>
> _______________________________________________
> splint-discuss mailing list
> splint-discuss@cs.virginia.edu
> http://www.splint.org/mailman/listinfo/splint-discuss
>
From roland.illig at gmx.de Tue Mar 15 18:39:25 2005
From: roland.illig at gmx.de (Roland Illig)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] parse errors
In-Reply-To: <2182.132.239.10.206.1110927204.squirrel@acs-webmail.ucsd.edu>
References: <2050.132.239.10.206.1110919305.squirrel@acs-webmail.ucsd.edu>
<2182.132.239.10.206.1110927204.squirrel@acs-webmail.ucsd.edu>
Message-ID: <4237722D.1060906@gmx.de>
Brian C. Lum wrote:
> I should be more specific about my code. We have a bunch of posixlib
> files included as well as our own files.
>
> The project is a HTTP Server. request.c takes a struct called
> HttpRequest, which goes to convert which makes a HttpResponse. In
> response.h, we defined the struct called HttpResponse. I get a parse
> error in content when I reach a line with anything we included ourselves.
The code looks quite good, but you did a tiny mistake:
> Line 45: HttpResponse* response = (HttpResponse *)
> malloc(sizeof(HttpResponse));
>
> Http Request from request.h is just:
> typedef struct HttpRequest
You're talking about HttpResponse, but giving us the definition of
HttpRequest. That might hide the real error.
You might provide us the definition of HttpResponse. Otherwise I'm
helpless. :(
Roland
From gregory.descamps at awtce.be Wed Mar 23 06:22:59 2005
From: gregory.descamps at awtce.be (gregory.descamps@awtce.be)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] include files > parse but no warning
Message-ID:
Hello,
I am currently working in Aisin-AW, in development of navigation systems
(embedded SW).
Since a few weeks, we are checking our source code with splint.
We encounter this problem. I hope this mailing-list can help us to solve
it :
Our team is responsible of 1 module.
In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.
How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?
For example, this is not working and we wonder why :
/*@ignore@*/
#include bad_file.h
/*@end@*/
warnings in "bad_file.h" are displayed, anyway.
thank you in advance !
gregory descamps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20050323/da703fe1/attachment.htm
From a.serebrenik at tue.nl Wed Mar 23 07:44:56 2005
From: a.serebrenik at tue.nl (Serebrenik, A.)
Date: Wed Mar 22 17:10:53 2006
Subject: [splint-discuss] Macros with Variable Numbers of Arguments
Message-ID: <9F38CF35D80CAE409B979F3EB5242B4A01628C76@winex2.campus.tue.nl>
Dear Splint-ers,
It seems that SPLINT does not understand macros with variable number of
arguments. My code contains the following line:
#define ThrowM(...) gsErrorMsg(__VA_ARGS__); throw
Here is the error reported by splint:
gslowlevel.h:35:57: Invalid character in macro parameter name
Preprocessing error. (Use -preproc to inhibit warning)
In file included from linearise.h:32,
from linearise.c:16
gslowlevel.h:35:57: Parameter list for #define is not parseable
<...>
Preprocessing error for file: /laquso/projects/genspect/src/linearise.c
*** Cannot continue.
I've checked chapter 11 of the manual (Macros) but it does not seem to
consider this kind of macros.
Best regards,
Alexander Serebrenik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20050323/0a3e7084/attachment.htm
From brian.quinlan at iolfree.ie Wed Mar 23 09:46:25 2005
From: brian.quinlan at iolfree.ie (Brian Quinlan)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] Macros with Variable Numbers of Arguments
In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A01628C76@winex2.campus.tue.nl>
References: <9F38CF35D80CAE409B979F3EB5242B4A01628C76@winex2.campus.tue.nl>
Message-ID: <1111589186.26112.98.camel@dub1-siena1>
On Wed, 2005-03-23 at 13:44 +0100, Serebrenik, A. wrote:
> Dear Splint-ers,
>
>
>
> It seems that SPLINT does not understand macros with variable number
> of
>
> arguments. My code contains the following line:
>
>
>
> #define ThrowM(...) gsErrorMsg(__VA_ARGS__); throw
>
Hi Alexander,
Is it "..." or "__VA_ARGS__" that splint is complaining about?
Splint can successfully parse the following macro for us:
#define SME_LOG_INFO(fmt...) \
MODULE_LOG(SME_MODULE_LOGGER_NAME, INFO, Sme_logMask, fmt)
After going through a series of other macros, fmt is passed to printf.
"fmt..." is slightly different to what you have below. Personally, I'm
not sure how to parse "..." on its own, but your compiler seems to be
happy with it. Does the "throw" mean this is C++? Splint isn't designed
to work with C++.
Bye,
Brian Quinlan
Duolog Technologies, www.duolog.com
>
>
> Here is the error reported by splint:
>
>
>
> gslowlevel.h:35:57: Invalid character in macro parameter name
>
> Preprocessing error. (Use -preproc to inhibit warning)
>
> In file included from linearise.h:32,
>
> from linearise.c:16
>
> gslowlevel.h:35:57: Parameter list for #define is not parseable
>
>
>
> <...>
>
> Preprocessing error for
> file: /laquso/projects/genspect/src/linearise.c
>
> *** Cannot continue.
>
>
>
> I've checked chapter 11 of the manual (Macros) but it does not seem
> to
>
> consider this kind of macros.
>
>
>
> Best regards,
>
> Alexander Serebrenik
>
>
> _______________________________________________
> splint-discuss mailing list
> splint-discuss@cs.virginia.edu
> http://www.splint.org/mailman/listinfo/splint-discuss
From chalin at cs.concordia.ca Wed Mar 23 10:48:29 2005
From: chalin at cs.concordia.ca (Patrice Chalin)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] software developer research survey on
errors/exceptions and program assertions
Message-ID: <42418FCD.1080503@cs.concordia.ca>
Dear Splint enthusiasts,
We are gathering the opinions of programmers on the topic of
"errors/exceptions and program assertions" via an online survey. Your
contribution would be greatly appreciated. Details are provided below.
Regards,
P.Chalin
------------------------------------------------------------------------
Concordia University's Dependable Software Research Group
(DSRG) requests your participation in an *online
research survey* for programmers that should take *no more than 10-20
min* to complete. The topic is: errors/exceptions and program
assertions. Survey results will help guide researchers in producing
tools that best correspond to software developer needs.
This is an invitation to *software developers* who work (or have worked)
with any one of the following languages: *C, C++, C#, and Java* (and
soon Ada).
The survey site is here: https://www.dsrg.org/ASN_Survey/.
Please consider forwarding this e-mail to other developers you might
know. Thank-you in advance for your time.
------------------------------------------------------------------------
--
Patrice Chalin, Assistant Professor - http://www.cs.concordia.ca/~chalin
Dependable Software Research Group, CSE Department, Concordia University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20050323/8ff40834/attachment.htm
From cbfalconer at yahoo.com Wed Mar 23 09:30:21 2005
From: cbfalconer at yahoo.com (CBFalconer)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] include files > parse but no warning
References:
Message-ID: <42417D7D.21657C23@yahoo.com>
gregory.descamps@awtce.be wrote:
>
... snip ...
> In our C files, we include Header files from others modules.
> Those files contain splint errors/warnings, but we cannot modify
> them.
>
> How can we use splint in order to parse those files (necessary
> for definitions), but without getting any warning ?
>
> For example, this is not working and we wonder why :
> /*@ignore@*/
> #include bad_file.h
> /*@end@*/
Please don't use html in e-mail. It is a major nuisance to
investigate its source for nasties before actually opening it, and
even then the font is too small to read. Text works just fine.
Why can't you replace the header file with a version closer to the
head of the header path for splint operation? If you can read it
you can copy it. Edit the copy. Then adjust the environment
variable larch_path as required.
--
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
From a.serebrenik at tue.nl Wed Mar 23 13:03:12 2005
From: a.serebrenik at tue.nl (Serebrenik, A.)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] Macros with Variable Numbers of Arguments
Message-ID: <9F38CF35D80CAE409B979F3EB5242B4A0164190E@winex2.campus.tue.nl>
Dear Brian,
Thank you very much for your response.
> > #define ThrowM(...) gsErrorMsg(__VA_ARGS__); throw
> Does the "throw" mean this is C++? Splint isn't designed to work with
C++.
This code is written in C. The 'throw' command mentioned in the example
is just another C macro, which indeed models the C++ throw by means of
"goto finally".
> Is it "..." or "__VA_ARGS__" that splint is complaining about?
Splint mentions position 57 which is in fact the newline character, and
reports all kinds of problems with parameters such as "Parameter list
for #define is not parseable" and "Invalid character in macro parameter
name".
Thatswhy, I've assumed that the problem has been caused by the
parameters and not by the __VA_ARGS__
> Personally, I'm not sure how to parse "..." on its own, but your
compiler > seems to be happy with it.
The 'ThrowM' macro is used to print an error message and then to move to
the 'finally' label. That's how it is used, for instance, 'ThrowM("No
system constant %t with type %t",*DataTerm,PosType);'
Best regards,
Alexander Serebrenik
From brian.quinlan at iolfree.ie Wed Mar 23 19:08:53 2005
From: brian.quinlan at iolfree.ie (Brian Quinlan)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] Macros with Variable Numbers of Arguments
In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A0164190E@winex2.campus.tue.nl>
References: <9F38CF35D80CAE409B979F3EB5242B4A0164190E@winex2.campus.tue.nl>
Message-ID: <1111622934.3621.54.camel@akebono>
On Wed, 2005-03-23 at 19:03 +0100, Serebrenik, A. wrote:
<>
> The 'ThrowM' macro is used to print an error message and then to move to
> the 'finally' label. That's how it is used, for instance, 'ThrowM("No
> system constant %t with type %t",*DataTerm,PosType);'
>
<>
Hi Alexander,
I did a little investigation to educate myself. It seems that format we
use for variable argument numbers:
#define SME_LOG_INFO(fmt...) \
MODULE_LOG(SME_MODULE_LOGGER_NAME, INFO, Sme_logMask, fmt)
keeps splint happier, but is less portable. While the format you use, is
more portable, but causes problems for splint:
#define ThrowM(...) gsErrorMsg(__VA_ARGS__); throw
See the following link for details:
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-
Manual/cpp/variadic-macros.html
Bye,
Brian
From cbfalconer at yahoo.com Fri Mar 25 18:03:44 2005
From: cbfalconer at yahoo.com (CBFalconer)
Date: Wed Mar 22 17:10:54 2006
Subject: [splint-discuss] Bug - Failure to preprocess correctly
Message-ID: <424498D0.F6ACB826@yahoo.com>
The following arose today. Source is correct. Carefully organized
to avoid overflows.
c:\c\diophan>splint diophan.c
Splint 3.0.1.6 --- 11 Feb 2002
diophan.c(13,28): #error "MAXRADIUS too big"
Preprocessing error for file: diophan.c
*** Cannot continue.
c:\c\diophan>set larch_path
.;c:\prgs\splint\splint-3.0.1.6\lib
c:\c\diophan>set include
c:\djgpp\include
Some of the source involved:
===========================
/* 181 allows operation with 16 bit ints */
#define MAXRADIUS 181
#define MAXDIMS 10
#if (INT_MAX / MAXRADIUS < MAXRADIUS)
# error "MAXRADIUS too big"
#endif
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson