This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17341] New: Bogus "unused parameter" warning with -O3
- From: "mckelvey at maskull dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2004 23:57:18 -0000
- Subject: [Bug c++/17341] New: Bogus "unused parameter" warning with -O3
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This "unused parameter" warning shows up with optimization. The parameter is
actually used.
/usr/local/bin/g++ -c -O3 -DNDEBUG -D__USE_STRING_INLINES=1
-pedantic-errors -Werror -ansi -fno-common -fstrict-aliasing -Wall
-Wold-style-cast -Wsign-promo -Wpointer-arith -Wconversion -Wundef
-Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual
-finline-limit=5000 -Wextra -MMD -fimplicit-templates -I. -I.. -o rot13.o
rot13.cc
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdboolean>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdboolean> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdboolean> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdstrings>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdstrings> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdstrings> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdintegers>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdintegers> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdintegers> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdfloats>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdfloats> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdfloats> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdbooleans>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdbooleans> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdbooleans> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
gmake: *** [rot13.o] Error 1
alpha1:PD>uname -a
Linux alpha1 2.4.9-40 #1 Mon Sep 23 08:14:02 EDT 2002 alpha unknown
alpha1:PD>g++ -v
Reading specs from /usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/specs
Configured with: ../gcc/configure --verbose --enable-languages=c++
Thread model: posix
gcc version 3.5.0 20040207 (experimental)
Configured:
alpha1:PD>alias CONFIGURECVS
alias CONFIGURECVS='../gcc/configure --verbose --enable-languages=c++
--disable-nls >clog 2>&1'
Built:
alpha1:PD>alias BUILD
alias BUILD='nice gmake CFLAGS='\'''\'' BOOT_CFLAGS='\''-O'\'' LIBCFLAGS='\''-g
-O'\'' LIBCXXFLAGS='\''-g -O'\'' bootstrap >log 2>&1'
--
Summary: Bogus "unused parameter" warning with -O3
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mckelvey at maskull dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: alphaev56-unknown-linux-gnu
GCC host triplet: alphaev56-unknown-linux-gnu
GCC target triplet: alphaev56-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17341