I suggest you ...

Expected Warning 438: Last value assigned to variable not used

Hi,

For the following code I really expected lint
warning 438. However, lint isn't complaining about
that. Not even when I use -w4 (it complains about
using ++ inside a function call, but not about
438, which is more serious in my opinion)

extern int f(void);
extern void g(int x);

void bla(void)
{
int x = f();
g(x++);
}

Am I misunderstanding something, or is Lint really
lacking here?

Note: If I change the code to do

g(x)
x++;

Which I would think is 'the same', I do get the
438 lint warning of course.

Best regards,

Arnaud Gouder de Beauregard

18 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base