Lots of warnings like this: ./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs] when building 1.54.0 with gcc-4.8.1 (fedora f19)
Lots of warnings like this:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
when building 1.54.0 with gcc-4.8.1 (fedora f19)
This warning is new in GCC 4.8, and I have been seeing a ton of them not just in boost, but in every codebase I've built. IMO gcc should not have this warning turned on by default. CC'ing the gcc folks. Regards, Nate
On 3 July 2013 02:41, Nathan Ridge wrote:
Lots of warnings like this:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
when building 1.54.0 with gcc-4.8.1 (fedora f19)
This warning is new in GCC 4.8, and I have been seeing a ton of them not just in boost, but in every codebase I've built.
It was new in GCC 4.7, http://gcc.gnu.org/gcc-4.7/changes.html It affects Boost more than most code because of the prevalent use of concept checks and static assertions which are usually implemented using typedefs but only conditionally compiled. I keep being surprised noone's disabled it in gcc.jam yet.
CC'ing the gcc folks.
That's not very helpful because posting to the Boost list is subscription only (you'll have two copies of this mail, because the first one I sent from an address subscribed to the GCC list but not this one.)
On 3 July 2013 09:32, Jonathan Wakely
I keep being surprised noone's disabled it in gcc.jam yet.
That wouldn't work for headers, as they get included when building with other build systems. Since this is new, I guess we can use pragmas to disable the warning, but that's a pain.
On 3 July 2013 02:41, Nathan Ridge wrote:
Lots of warnings like this:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
when building 1.54.0 with gcc-4.8.1 (fedora f19)
This warning is new in GCC 4.8, and I have been seeing a ton of them not just in boost, but in every codebase I've built.
It was new in GCC 4.7, http://gcc.gnu.org/gcc-4.7/changes.html
I stand corrected. (What's new in 4.8 is it being included in -Wall, which is why I never noticed it in 4.7).
It affects Boost more than most code because of the prevalent use of concept checks and static assertions which are usually implemented using typedefs but only conditionally compiled.
I've seen spews of that warning for other large projects, such as clang or wxWidgets, not just boost. Would GCC consider removing it from -Wall?
CC'ing the gcc folks.
That's not very helpful because posting to the Boost list is subscription only (you'll have two copies of this mail, because the first one I sent from an address subscribed to the GCC list but not this one.)
My apologies. Regards, Nate
Nathan Ridge
On 3 July 2013 02:41, Nathan Ridge wrote:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
It was new in GCC 4.7, http://gcc.gnu.org/gcc-4.7/changes.html
I've seen spews of that warning for other large projects, such as clang or wxWidgets, not just boost.
Would GCC consider removing it from -Wall?
GCC doesn't emit this warning if such typedefs are annotated with __attribute__((__unused__)). We just need to fix all instances of this problem. So far I identified these there: - https://svn.boost.org/trac/boost/ticket/8844 (Boost.Bind) - https://svn.boost.org/trac/boost/ticket/8847 (Boost.ConceptCheck) - https://svn.boost.org/trac/boost/ticket/8859 (Boost.Serialization) Thanks, PM
The Boost.ConceptCheck has already been fixed in the trunk. I've raised tickets for the following additional warnings: - https://svn.boost.org/trac/boost/ticket/8853 [tuple] - https://svn.boost.org/trac/boost/ticket/8854 [random] - https://svn.boost.org/trac/boost/ticket/8855 [math] - https://svn.boost.org/trac/boost/ticket/8856 [date_time] -- View this message in context: http://boost.2283326.n4.nabble.com/lots-of-warning-with-gcc-4-8-1-boost-1-54... Sent from the Boost - Dev mailing list archive at Nabble.com.
It would be great to have them fixed before the 1.55 release (So far only #8855 has been). Also add #8726 to the list. -- View this message in context: http://boost.2283326.n4.nabble.com/lots-of-warning-with-gcc-4-8-1-boost-1-54... Sent from the Boost - Dev mailing list archive at Nabble.com.
On 03/07/13 10:32, Jonathan Wakely wrote:
On 3 July 2013 02:41, Nathan Ridge wrote:
Lots of warnings like this:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
when building 1.54.0 with gcc-4.8.1 (fedora f19)
This warning is new in GCC 4.8, and I have been seeing a ton of them not just in boost, but in every codebase I've built.
It was new in GCC 4.7, http://gcc.gnu.org/gcc-4.7/changes.html
It affects Boost more than most code because of the prevalent use of concept checks and static assertions which are usually implemented using typedefs but only conditionally compiled.
Unused local typedefs is a real bug. It's Boost that needs fixing IMHO. If it's for a static assert trick, just write your trick differently to not require it or just use one of the provided macros that do it right.
You can include boost headers using -isystem which will suppress these
warnings
-isystem dir Search dir for header files, after all directories specified
by -I but before the standard system directories. *Mark it as a system
directory, so that it gets the same special treatment as is applied to the
standard system directories*
On 3 July 2013 11:29, Neal Becker
Lots of warnings like this:
./boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]
when building 1.54.0 with gcc-4.8.1 (fedora f19)
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (8)
-
Chris Stylianou
-
Daniel James
-
Jonathan Wakely
-
Mathias Gaunard
-
Nathan Ridge
-
Neal Becker
-
Petr Machata
-
Steve Lorimer