Bug #5465
closedWt4 with gcc6 spurious(?) placement new warnings
0%
Description
With Debian stretch (testing) and g "(Debian 6.2.1-5) 6.2.1 20161124", a build of Wt4 preview (github 3.3.6-16-ged99039c) results in numerous placement new warnings. Here's an example for WComboBox.C (with abbreviated paths).
cd /wt4p-static-build/src && /usr/bin/c++ -DBOOST_SPIRIT_THREADSAFE -DGLEW_STATIC -DHAVE_GRAPHICSMAGICK -DHAVE_PANGO -DHAVE_PDF_IMAGE -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DWT_BUILDING -DWT_WITH_OLD_INTERNALPATH_API -D_REENTRANT -I/wt4p-static-build -I/wt4p/src/web -I/wt4p/src -I/wt4p-static-build/src -I/wt4p/src/Wt/Dbo/backend/amalgamation -I/wt4p/src/3rdparty/glew-1.10.0/include -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtCore -I/x/boost/boost_1_62/include/boost-1_62 -I/x/libharu/include -I/usr/include/GraphicsMagick -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -std=c++14 -B/usr/lib/gold-ld -std=c++14 -O2 -g -DNDEBUG -o CMakeFiles/wt.dir/Wt/WComboBox.o -c /wt4p/src/Wt/WComboBox.C
In file included from /wt4p/src/Wt/cpp17/any.hpp:78:0,
from /wt4p/src/Wt/WAny:11,
from /wt4p/src/Wt/WAny.h:7,
from /wt4p/src/Wt/WModelIndex:15,
from /wt4p/src/Wt/WModelIndex.h:7,
from /wt4p/src/Wt/WAbstractItemModel:11,
from /wt4p/src/Wt/WAbstractItemModel.h:7,
from /wt4p/src/Wt/WAbstractListModel:10,
from /wt4p/src/Wt/WAbstractListModel.h:7,
from /wt4p/src/Wt/WStringListModel:10,
from /wt4p/src/Wt/WStringListModel.h:7,
from /wt4p/src/Wt/WComboBox.C:9:
/wt4p/src/Wt/cpp17/any/any.hpp: In instantiation of ‘void linb::any::construct(ValueType&&) [with ValueType = const Wt::WString&]’:
/wt4p/src/Wt/cpp17/any/any.hpp:81:9: required from ‘linb::any::any(ValueType&&) [with ValueType = const Wt::WString&; <template-parameter-1-2> = void]’
/wt4p/src/Wt/WComboBox.C:162:55: required from here
/wt4p/src/Wt/cpp17/any/any.hpp:350:13: warning: placement new constructing an object of type ‘T {aka Wt::WString}’ and size ‘40’ in a region of type ‘linb::any::storage_union::stack_storage_t {aka std::aligned_storage<16ul, 8ul>::type}’ and size ‘16’ [-Wplacement-new=]
new (&storage.stack) T(std::forward<ValueType>(value));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It looks like the compiler warnings may be inaccurate; there's an open gcc bug report that seems relevant here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70834.
The issue is also triggered with upstream's test_any.cpp. If the compiler warning is confirmed to be incorrect, it can be suppressed with pragmas in any.hpp.
The preview looks great, by the way. I'm looking forward to testing it with some apps. Thanks for releasing it!
Files
Updated by Bruce Toll over 7 years ago
- File 0001-Ignore-gcc-6-placement-new-warnings-in-any.hpp.patch 0001-Ignore-gcc-6-placement-new-warnings-in-any.hpp.patch added
FYI, this is the patch I used to suppress the warnings while testing...
Updated by Roel Standaert over 7 years ago
- Status changed from New to InProgress
- Assignee set to Roel Standaert
Updated by Roel Standaert over 7 years ago
- Status changed from InProgress to Resolved
Instead of ignoring the warnings, I used std::enable_if instead of the normal if statement.
Updated by Roel Standaert over 6 years ago
- Status changed from Resolved to Closed