Related articles |
---|
C compiler warning messages? johnr@ims.com (1997-04-06) |
Re: C compiler warning messages? trt@duke.cs.duke.edu (1997-04-07) |
Re: C compiler warning messages? morris@CAM.ORG (1997-04-08) |
Re: C compiler warning messages? chase@naturalbridge.com (David Chase) (1997-04-11) |
Re: C compiler warning messages? joshua@intrinsa.com (1997-04-16) |
Re: C compiler warning messages? morris@CAM.ORG (Morris Bernstein) (1997-04-16) |
Re: C compiler warning messages? oz@ds9.rnd.border.com (1997-04-18) |
From: | oz@ds9.rnd.border.com (ozan s. yigit) |
Newsgroups: | comp.compilers |
Date: | 18 Apr 1997 01:13:11 -0400 |
Organization: | The Electric Skillet |
References: | 97-04-042 97-04-074 |
Keywords: | errors, analysis, tools |
in case people who are not familiar with lclint would be interested to
see what it does on that little more complicated piece, with
default lclint options and -show-column:
1 char *foo(int arg)
2 {
3 char bar[30], *baz ;
4
5 baz = bar ;
6 if (arg) baz = "foo" ;
7 return baz ;
8 }
LCLint 2.2a --- 04 Sep 96
code.c: (in function foo)
code.c:6: Clauses exit with baz referencing unqualified static storage in true
branch, stack storage in continuation
The state of a variable is different depending on which branch is taken. This
means no annotation can sensibly be applied to the storage. (-branchstate
will suppress message)
code.c:5: Storage baz becomes stack
code.c:6: Storage baz becomes unqualified static
code.c:6: Clauses exit with bar referencing unqualified static storage in true
branch, stack storage in continuation
code.c:6: Storage bar becomes unqualified static
code.c:6: Test expression for if not bool, type int: arg
Test expression type is not boolean or int. (-predboolint will suppress
message)
code.c:7: Returned storage baz not completely defined (*baz is undefined): baz
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.
(-compdef will suppress message)
code.c:7: Observer storage baz returned without qualification: baz
Observer storage is transferred to a non-observer reference. (-observertrans
will suppress message)
code.c:6: Storage baz becomes observer
Finished LCLint checking --- 5 code errors found
[tragedy of lint: it brings strong checking to its gods and causes
great humiliation. gods cannot be shown to be so fallible; it gets
locked up in a dark cellar of forgotten tools, forever haunted by the
agony of those suffering unchecked, broken programs of these
gods... or maybe its liver was forever plucked by an eagle. i forgot
which. :)]
oz (oz@border.com)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.