Bug 18183 - Warning when supposedly unused parameters are used
Summary: Warning when supposedly unused parameters are used
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-27 16:27 UTC by M Welinder
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M Welinder 2004-10-27 16:27:57 UTC
It would be nice to get a warning for the code below when bar is used.
Using something documented as unused is likely a bug.

void
foo (int __attribute__((unused)) bar)
{
  bar++;
}

> gcc-3.4 -W -Wunused -Wall -O2 -c ~/foo.c
>
Comment 1 Andrew Pinski 2004-10-27 16:34:08 UTC
I think there was another bug about this and it was closed because we use unused to mean it might be 
unused not that it is just unused.
Comment 2 Andrew Pinski 2004-10-29 17:37:34 UTC
unused is really a marker for maybe unused and that is it.