From cbfalconer at yahoo.com Mon Dec 1 09:10:48 2003 From: cbfalconer at yahoo.com (CBFalconer) Date: Wed Mar 22 17:10:21 2006 Subject: [splint-discuss] How can I overcome these two warnings? References: Message-ID: <3FCB4BE8.DA1D9D6E@yahoo.com> FND-AD YAO Roy wrote: > > Part 1.1 Type: Plain Text (text/plain) > Encoding: quoted-printable You might start by avoiding html or attachments in e-mail, which is also a security risk. After that it is possible your problems have to do with the global space shortage, and your attempts to avoid exacerbating it. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. USE worldnet address! From Jay.St.Pierre at Colorado.EDU Wed Dec 3 19:02:13 2003 From: Jay.St.Pierre at Colorado.EDU (Jay A. St. Pierre) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Problem with /*@relnull@*/ annotation Message-ID: For this piece of code: -----Begin----- #include typedef /*@null@*/ int * nip_type; int foo=1; nip_type /*@shared@*/ nip=&foo; int main(void) { /*@relnull@*/ int * int_ptr; int_ptr = nip; printf(" *int_ptr = %d\n", *int_ptr); return 0; } -----End----- When I run splint, I get: -----Begin----- ~> splint -exportlocal foo.c Splint 3.1.1 --- 20 May 2003 foo.c: (in function main) foo.c:14:31: Dereference of possibly null pointer int_ptr: *int_ptr A possibly null pointer is dereferenced. Value is either the result of a function which may return null (in which case, code should check it is not null), or a global, parameter or structure field declared with the null qualifier. (Use -nullderef to inhibit warning) foo.c:12:13: Storage int_ptr may become null Finished checking --- 1 code warning -----End----- My interpretation of what is in the manual is that the /*@relnull@*/ annotation should've quelled the warning. Am I misunderstanding something here? Is there an annotation other than turning off the "nullderef" flag that will make the warning go away. I have static functions in my code that cannot be accessed if the pointer were really null, so I don't want to add in redundant "is null" checks. -Jay From roland.illig at gmx.de Thu Dec 4 03:34:47 2003 From: roland.illig at gmx.de (Roland Illig) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Problem with /*@relnull@*/ annotation In-Reply-To: References: Message-ID: <20031204083447.GA1364@informatik.uni-hamburg.de> On Wed, Dec 03, 2003 at 05:02:13PM -0700, Jay A. St. Pierre wrote: > For this piece of code: > > -----Begin----- > #include > > typedef /*@null@*/ int * nip_type; > > int foo=1; > nip_type /*@shared@*/ nip=&foo; > > int main(void) > { > /*@relnull@*/ int * int_ptr; > > int_ptr = nip; > > printf(" *int_ptr = %d\n", *int_ptr); > > return 0; > } > [...] > go away. I have static functions in my code that cannot be > accessed if the pointer were really null, so I don't want to add > in redundant "is null" checks. Perhaps you want to declare nip as: static /*@shared@*/ /*@notnull@*/ const nip_type nip = &foo; I'm not sure about the "const", but the /*@notnull@*/ may be what you want. Roland From jaroslaw.nozderko at polkomtel.com.pl Thu Dec 4 09:18:22 2003 From: jaroslaw.nozderko at polkomtel.com.pl (=?iso-8859-2?Q?Jaros=B3aw_Nozderko?=) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Build error on HP-UX Message-ID: <2A857CE92C11FE40858689CAEC7BED4907A1DA2D@E2K2.corp.plusnet> splint 3.1.1 $ uname -a HP-UX rad B.11.11 U 9000/800 1398917738 unlimited-user license $ gmake -v GNU Make 3.80 Hi, I've just tried to build splint 3.1.1 on HP-UX (details above) and compilation fails as follows (configure output attached for clarity). $ ./configure checking build system type... hppa2.0w-hp-hpux11.11 checking host system type... hppa2.0w-hp-hpux11.11 checking target system type... hppa2.0w-hp-hpux11.11 checking for a BSD-compatible install... /opt/imake/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking for gcc... no checking for cc... cc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... no checking whether cc accepts -g... yes checking for cc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of cc... hp checking how to run the C preprocessor... cc -E checking for flex... no checking for lex... lex checking for yywrap in -lfl... no checking for yywrap in -ll... yes checking lex output file root... lex.yy checking whether yytext is a pointer... no checking for a BSD-compatible install... /opt/imake/bin/install -c checking whether make sets $(MAKE)... (cached) yes checking whether ln -s works... yes checking for bison... no checking for grep... grep checking for diff... diff checking for cat... cat checking for rm... rm checking for mv... mv checking for cp... cp checking for sed... sed checking whether we need _ALL_SOURCE to expose mode_t... no checking whether to include support for LCL files... yes configure: creating ./config.status config.status: creating Makefile config.status: creating imports/Makefile config.status: creating lib/Makefile config.status: creating src/Makefile config.status: creating test/Makefile config.status: creating doc/Makefile config.status: creating bin/Makefile config.status: creating config.h config.status: executing depfiles commands $ gmake gmake all-recursive gmake[1]: Entering directory `/var/mqm/ad_spec_dev/dad_jxn/prog/tools/splint/bui ld/splint-3.1.1' Making all in src gmake[2]: Entering directory `/var/mqm/ad_spec_dev/dad_jxn/prog/tools/splint/bui ld/splint-3.1.1/src' Compiling cgrammar.c... cc: "Headers/lclinit.h", line 11: error 1000: Unexpected symbol: "LCLInitRuleCod e". cc: "Headers/forwardTypes.h", line 96: error 1574: Unknown size for "LSLInitRule Code". cc: "Headers/forwardTypes.h", line 96: error 1713: Illegal redeclaration for ide ntifier "LSLInitRuleCode". gmake[2]: *** [cgrammar.o] Error 1 gmake[2]: Leaving directory `/var/mqm/ad_spec_dev/dad_jxn/prog/tools/splint/buil d/splint-3.1.1/src' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/var/mqm/ad_spec_dev/dad_jxn/prog/tools/splint/buil d/splint-3.1.1' gmake: *** [all] Error 2 It looks like some missing declarations ? Do I miss something obvious ? I've checked FAQ and list archives, but couldn't find anything meaningful. Thanks a lot for any help. Best regards, Jarek From Jay.St.Pierre at Colorado.EDU Thu Dec 4 12:28:14 2003 From: Jay.St.Pierre at Colorado.EDU (Jay A. St. Pierre) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Problem with /*@relnull@*/ annotation In-Reply-To: <20031204083447.GA1364@informatik.uni-hamburg.de> Message-ID: On Thu, 4 Dec 2003, Roland Illig wrote: > Perhaps you want to declare nip as: > > static /*@shared@*/ /*@notnull@*/ const nip_type nip = &foo; > > I'm not sure about the "const", but the /*@notnull@*/ may be what you > want. Well, that would work for my over-simplified example. The following is more representative of what I'm trying to do: ---- begin ---- #include #include typedef /*@null@*/ int * nip_type; int foo=1; bool is_initialized=false; nip_type /*@shared@*/ nip = NULL; void initialize(void) { nip = &foo; is_initialized = true; } void print_value(void) { /*@relnull@*/ int * int_ptr; if ( is_initialized ) { int_ptr = nip; printf(" *int_ptr = %d\n", *int_ptr); } } --- end --- Which still produces the error: ---- begin ---- Splint 3.1.1 --- 20 May 2003 foo.c: (in function print_value) foo.c:23:33: Dereference of possibly null pointer int_ptr: *int_ptr A possibly null pointer is dereferenced. Value is either the result of a function which may return null (in which case, code should check it is not null), or a global, parameter or structure field declared with the null qualifier. (Use -nullderef to inhibit warning) foo.c:21:15: Storage int_ptr may become null Finished checking --- 1 code warning ---- end ---- Again, in the simplified example above I could easily check to see if nip is not null instead of the "is_initialized" flag, but this is more representative of my real code. In other words, when I've reached the point where "int_ptr" will be dereferenced, I've already done a check that implies nip, thus int_ptr, is really not NULL. -Jay From tomlink at csi.com Fri Dec 5 16:29:16 2003 From: tomlink at csi.com (Tom Link) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Splint With PalmOS Source Code Message-ID: <3FD0F8AC.3030002@csi.com> I am trying to use splint with PalmOS source code, but one of the Palm header files causes problems I cannot seem to get around. PalmOS System calls (and other shared library calls) are implemented with functions declared using the syntax: Retval SomeFunction(parameters ....) SYS_TRAP(trapnum); It seems that the SYS_TRAP macro at the end causes: Parse Error: New function scope inside function. Does anyone have a suggestion on a bypass for this? Tom Link From kwalton at sierrawireless.com Fri Dec 5 18:20:47 2003 From: kwalton at sierrawireless.com (Kevin Walton) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Problem with #include Message-ID: <1CE21D1826DD4E408A178AF4182203F912DFD1@ICE.sierrawireless.local> For this piece of code: type.h: -----Begin----- #ifdef TYPE #include TYPE #else #error Must Specify -DTYPE=x.h #endif ------End------ type.c: -----Begin----- #include "type.h" ------End------ When I run 'splint -DTYPE="type_a.h" type.c' I get: -----Begin----- Splint 3.1.1 --- 12 April 2003 type.h(2,14): Preprocessor command #include expects "FILENAME" or Preprocessing error. (Use -preproc to inhibit warning) In file included from type.c(1) Preprocessing error for file: type.c *** Cannot continue. ------End------ Does anyone know a way around this? I've also tried 'splint -DTYPE=\"type_a.h\" type.c' (adding the "\") but it gives the same result. I can get around it by adding "#ifdef S_SPLINT_S" to type.h, but would prefer not to if possible. Thx, Kevin From mdeepak at tataelxsi.co.in Mon Dec 8 09:48:28 2003 From: mdeepak at tataelxsi.co.in (Deepak Mohan) Date: Wed Mar 22 17:10:22 2006 Subject: [splint-discuss] Newbie. "Function exported, but not specified" Message-ID: Hi, Suppose I have 2 files, the contents of which are given below. file_one.h ---------- extern int function_one(int, int); file_one.c ---------- #include "file_one.h" int function_one(int a, int b) { return (a+b); } main.c ------ #include "file_one.h" int main(void) { int iretval; iretval = function_one(10, 20); } I invoke splint like this "splint -strict *.c" Splint then gives the following warining " file_one.h(2,12): Function exported, but not specified: function_one A function is exported, but not specified. (Use -exportfcn to inhibit warning) " What is the problem with the source files? How can I change the files to prevent these warnings? TIA.....