Bug 30416

Summary: -Wall does not include -Wunused-parameter
Product: [Retired] Red Hat Linux Reporter: Wagner T. Correa <wtcorrea>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-03 03:10:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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'.