Bug 30416 - -Wall does not include -Wunused-parameter
Summary: -Wall does not include -Wunused-parameter
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-03 03:10 UTC by Wagner T. Correa
Modified: 2007-04-18 16:31 UTC (History)
0 users

Clone Of:
Last Closed: 2001-03-03 03:10:54 UTC

Attachments (Terms of Use)

Description Wagner T. Correa 2001-03-03 03:10:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22smp i686)

According to the man page, -Wall implies -Wunused-parameter, but tests show
it doesn't.

Reproducible: Always
Steps to Reproduce:
Create a foo.c file the the following line:

int foo(int a) { return 0; }

Then, compile with:

gcc -Wall -c foo.c

You will get no warnings.

If you compile with:

gcc -Wall -Wunused-parameter -c foo.c

Then you get the warning:

foo.c: In function `foo':
foo.c:1: warning: unused parameter `a'

By the way, the -Wunused, which is also supposed to imply
-Wunused-parameter, does not work either.

Comment 1 Wagner T. Correa 2001-03-06 07:50:11 UTC
Sorry. This is not a bug. I misread the man page, which says:

In order to get a warning about an unused  function
parameter, you must either specify `-W -Wunused' or
separatly specify `-Wunused-parameter'.

Note You need to log in before you can comment on or make changes to this bug.