Bug 70946 - warnings in standard headers when using -Wshadow
Summary: warnings in standard headers when using -Wshadow
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-07 07:40 UTC by Wagner T. Correa
Modified: 2007-04-18 16:45 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-03 00:29:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Wagner T. Correa 2002-08-07 07:40:54 UTC
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-03 00:29:12 UTC
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.