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'
Created attachment 7058 [details] Preprocessed source
The only warnings I get are for pr17341.cc:22444: warning: suggest parentheses around assignment used as truth value Does this still happen?
Waiting for user's feedback
Subject: Re: [3.5 Regression] Bogus "unused parameter" warning with -O3 On Wednesday 08 September 2004 20:41 pm, pinskia at gcc dot gnu dot org wrote: > ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-09 > 03:41 ------- The only warnings I get are for > pr17341.cc:22444: warning: suggest parentheses around assignment used as > truth value > > > Does this still happen? I was able to bootstrap yesterday, and I no longer see this problem.
So closing as fixed.