Bug 70946 - warnings in standard headers when using -Wshadow
warnings in standard headers when using -Wshadow
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-07 03:40 EDT by Wagner T. Correa
Modified: 2007-04-18 12:45 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 20:29:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wagner T. Correa 2002-08-07 03:40:54 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

Description of problem:
When I use the -Wshadow option, some standard header files produce warnings.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. compile the file below

#include <math.h>
#include <string>
#include <hash_map>


Actual Results:  [wtcorrea@neon17 wtcorrea]$ g++ -Wall -Wshadow -c x.cpp 
In file included from /usr/include/g++-3/string:6,
                 from x.cpp:2:
/usr/include/g++-3/std/bastring.h: In method `basic_string<charT, 
traits, Allocator> &basic_string<charT, traits, Allocator>::replace 
(charT *, charT *, InputIterator, InputIterator)':
/usr/include/g++-3/std/bastring.h:442: warning: declaration of `j1' shadows
global declaration
In file included from /usr/include/g++-3/hash_map:31,
                 from x.cpp:3:
/usr/include/g++-3/stl_hashtable.h: In method `void hashtable<_Val, 
_Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_copy_from (const 
hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc> &)':
/usr/include/g++-3/stl_hashtable.h:1017: warning: declaration of `__copy'
shadows global declaration


Expected Results:  I would expect the standard headers to be warning free.


Additional info:

gcc-2.96-108.7.2
Comment 1 Richard Henderson 2004-10-02 20:29:12 EDT
We are in fact warning free for these specific headers in gcc 3.2.

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