On 8/14/08, Maarten Brock <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've never used any but I wonder what a lint would do
> with this.
(* please excuse me if this posts in formatted HTML, I'm using google-mail
for the first time *)
Actually, not that much complaint...
Supress error 552 and things ain't that bad.
+++++++++++++++
PC-lint for C/C++ (NT) Vers. 8.00v, Copyright Gimpel Software 1985-2006
--- Module: C:\DVC96F_Local\CPF0034E\SRC\flim.c (C)
_
1,2,3; 4;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 7 Warning 505: Redundant left argument
to comma
C:\DVC96F_Local\CPF0034E\SRC\flim.c 7 Warning 505: Redundant left argument
to comma
C:\DVC96F_Local\CPF0034E\SRC\flim.c 7 Warning 522: Expected void type,
assignment, increment or decrement
C:\DVC96F_Local\CPF0034E\SRC\flim.c 7 Warning 522: Expected void type,
assignment, increment or decrement
_
5;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 9 Warning 522: Expected void type,
assignment, increment or decrement
_
5 == 6;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 11 Warning 522: Expected void type,
assignment, increment or decrement
_
7 / 8 == 78;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 13 Warning 522: Expected void type,
assignment, increment or decrement
_
90;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 16 Warning 522: Expected void type,
assignment, increment or decrement
_
"without error" ;;; "to"
C:\DVC96F_Local\CPF0034E\SRC\flim.c 19 Warning 522: Expected void type,
assignment, increment or decrement
_
"Don't we all like C" ? "No" : "No"; !"YES";
C:\DVC96F_Local\CPF0034E\SRC\flim.c 22 Warning 522: Expected void type,
assignment, increment or decrement
C:\DVC96F_Local\CPF0034E\SRC\flim.c 22 Warning 522: Expected void type,
assignment, increment or decrement
_
return ~!!i?i==8:8%+8;-7;;
C:\DVC96F_Local\CPF0034E\SRC\flim.c 24 Warning 514: Unusual use of a
Boolean expression
C:\DVC96F_Local\CPF0034E\SRC\flim.c 24 Warning 527: Unreachable code at
token '-'
C:\DVC96F_Local\CPF0034E\SRC\flim.c 24 Warning 522: Expected void type,
assignment, increment or decrement
_
}
C:\DVC96F_Local\CPF0034E\SRC\flim.c 25 Warning 533: function 'main(void)'
should return a value (see line 1)
C:\DVC96F_Local\CPF0034E\SRC\flim.c 1 Info 830: Location cited in prior
message
+++++++++++++++
Maarten
>
>
> > frieder wrote:
> > > Hi Arkadi
> > >
> > > Arkadi Shishlov schrieb:
> > > > Is it possible to get a warning from the compiler for suspicious
> lines of
> > > code like
> > > > some_var == 123;
> > > > that makes little sense.
> > > > ?
> > >
> > > Indeed!)
> > >
> > > This one probably makes even less sense but also
> > > passes without error (both GCC and SDCC:)
> >
> > GCC gives plenty of warnings with -Wall:
> > $ gcc -Wall f.c
> > f.c: In function 'main':
> > f.c:5: warning: the address of 'foo' will always evaluate as 'true'
> > f.c:7: warning: the address of 'foo' will always evaluate as 'true'
> > f.c:8: warning: left-hand operand of comma expression has no effect
> > f.c:8: warning: left-hand operand of comma expression has no effect
> > f.c:8: warning: statement with no effect
> > f.c:8: warning: statement with no effect
> > f.c:10: warning: statement with no effect
> > f.c:12: warning: statement with no effect
> > f.c:14: warning: statement with no effect
> > f.c:17: warning: statement with no effect
> > f.c:20: warning: statement with no effect
> > f.c:23: warning: statement with no effect
> > f.c:23: warning: statement with no effect
> > f.c:25: warning: statement with no effect
> >
> >
> > >
> > >
> > > ------8<------------------------------------------
> > > void foo(){} int main( void )
> > > {
> > > int i = foo?
> > > 100:10;
> > >
> > > while( foo && i-- )
> > > 1,2,3; 4;
> > >
> > > 5;
> > >
> > > 5 == 6;
> > >
> > > 7 / 8 == 78;
> > >
> > > 7/8 ? (79):
> > > 90;
> > >
> > > "GCC 4.3.1 and SDCC 2.8.2 eat this"
> > > "without error" ;;; "to"
> > > "be more accurate: also without warning"
> > >
> > > "Don't we all like C" ? "No" : "No"; !"YES";
> > >
> > > return ~!!i?i==8:8%+8;-7;;
> > > }
> > > ------>8------------------------------------------
> > >
> > >
> -------------------------------------------------------------------------
> > > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > > Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> > > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > > _______________________________________________
> > > Sdcc-user mailing list
> > > Sdcc-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/sdcc-user
> >
> > =---------------------
> > paul fox, [EMAIL PROTECTED]
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Sdcc-user mailing list
> > Sdcc-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sdcc-user
> >
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user