Home › Forum › SOFA › Building SOFA › [SOLVED] Compilation warnings "unused typedef"
- This topic has 2 replies, 2 voices, and was last updated 9 years ago by Etienne.
-
AuthorPosts
-
1 November 2015 at 03:53 #3906François FaureBlocked
Hi,
I wonder how to suppress compilation warnings such as unused typedef.
Adding -Wno-unused-local-typedef in variable CMAKE_CXX_FLAGS has no effect. Looking at the full compile command (by writing VERBOSE=”1″ in the QtCreator Build options/Make arguments), I get:[ 36%] Building CXX object SofaGeneral/SofaOpenglVisual/CMakeFiles/SofaOpenglVisual.dir/VisualManagerSecondaryPass.cpp.o cd /Users/ffaure/scm/SOFA/sofa-build-debug/SofaGeneral/SofaOpenglVisual && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DSofaOpenglVisual_EXPORTS -Wno-unused-local-typedef -Wall -W -g -DSOFA_DEBUG -fPIC -I/Users/ffaure/scm/SOFA/sofa/SofaGeneral/../modules -I/Users/ffaure/scm/SOFA/sofa-build-debug/include -I/Users/ffaure/scm/SOFA/sofa/SofaBase/../modules -I/Users/ffaure/scm/SOFA/sofa/SofaSimulation/../modules -I/Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../.. -I/Users/ffaure/scm/SOFA/sofa/framework/sofa/defaulttype/../.. -I/Users/ffaure/scm/SOFA/sofa/framework/sofa/helper/../.. -isystem /opt/local/include -I/Users/ffaure/scm/SOFA/sofa/extlibs/eigen-3.2.5 -I/Users/ffaure/scm/SOFA/sofa-build-debug/SofaFramework -I/Users/ffaure/scm/SOFA/sofa/extlibs/tinyxml -isystem /usr/local/include -DSOFA_BUILD_OPENGL_VISUAL -o CMakeFiles/SofaOpenglVisual.dir/VisualManagerSecondaryPass.cpp.o -c /Users/ffaure/scm/SOFA/sofa/modules/SofaOpenglVisual/VisualManagerSecondaryPass.cpp In file included from /Users/ffaure/scm/SOFA/sofa/modules/SofaMiscTopology/TopologicalChangeProcessor.cpp:25: In file included from /Users/ffaure/scm/SOFA/sofa/SofaMisc/../modules/SofaMiscTopology/TopologicalChangeProcessor.h:29: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/core/topology/BaseMeshTopology.h:32: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/core/topology/Topology.h:28: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/core/objectmodel/BaseObject.h:28: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/core/objectmodel/Base.h:31: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/helper/vector.h:39: In file included from /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/defaulttype/DataTypeInfo.h:29: /Users/ffaure/scm/SOFA/sofa/framework/sofa/core/../../sofa/helper/fixed_array.h:100:9: warning: unused typedef 'boost_static_assert_typedef_100' [-Wunused-local-typedef]
So my guess is that the -Wall which appears after my -Wno-unused-local-typedefs overloads it. How to remove this -Wall, or to set a flag that appears after it ?
1 November 2015 at 04:03 #3907François FaureBlockedJust found a workaround: Appending -Wno-unused-local-typedef to variable CMAKE_CXX_FLAGS_DEBUG does the job (as I am compiling in debug mode), since these flags appear after the -Wall.
1 November 2015 at 12:35 #3908EtienneBlockedHello,
I assume you’re using clang to compile SOFA.
This warning is due to a bug in boost when using BOOST_STATIC_ASSERT. It will be solved in boost 1.60.
If you want a temporary worckaround, you can set __GNUC_MINOR__ to at least 7 in your environment before compiling.
By default clang defines __GNUC__ to 4 and __GNUC_MINOR__ to 2.
Again with the next version of boost this will be solved.Etienne.
// // If the compiler warns about unused typedefs then enable this: // #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) # define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) #else # define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE #endif
-
AuthorPosts
- You must be logged in to reply to this topic.