[fixed] new boost warnings in master

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[fixed] new boost warnings in master

Post by uwestoehr »

back on my second development PC I had to perform a complete recompilation from scratch. This gives me now tons of these new warnings:

Code: Select all

20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): warning C4005: 'BOOST_NO_CXX98_FUNCTION_BASE': macro redefinition (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\PropertySheet.cpp)
20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): message : 'BOOST_NO_CXX98_FUNCTION_BASE' previously declared on the command line (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\PropertySheet.cpp)
20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): warning C4005: 'BOOST_NO_CXX98_FUNCTION_BASE': macro redefinition (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\SheetPyImp.cpp)
20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): message : 'BOOST_NO_CXX98_FUNCTION_BASE' previously declared on the command line (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\SheetPyImp.cpp)
20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): warning C4005: 'BOOST_NO_CXX98_FUNCTION_BASE': macro redefinition (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\Sheet.cpp)
20>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): message : 'BOOST_NO_CXX98_FUNCTION_BASE' previously declared on the command line (compiling source file D:\FreeCAD-git\src\Mod\Spreadsheet\App\Sheet.cpp)
19>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): warning C4005: 'BOOST_NO_CXX98_FUNCTION_BASE': macro redefinition (compiling source file D:\FreeCAD-git\src\Mod\Start\App\AppStart.cpp)
19>D:\FreeCAD-build\LibPack-OCC76-V2\include\boost/config/stdlib/dinkumware.hpp(213,1): message : 'BOOST_NO_CXX98_FUNCTION_BASE' previously declared on the command line (compiling source file D:\FreeCAD-git\src\Mod\Start\App\AppStart.cpp)
...
many WBs are affected, therefore I was not yet able to figure out what is causing this. Does anybody have an idea?
I compile using PCH and Visual Studio.
@chennes in the logs i see that you recently changed some precompiled headers. Thus maybe you have an idea?
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: new boost warnings in master

Post by uwestoehr »

Thanks.
@berniev Can you please have a look?
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: new boost warnings in master

Post by berniev »

My original PR built fine here. It is a fix for C++20.

But apparently was not suitable for older versions of cmake. What version of cmake are you using?

So the functionality was moved and changed ever so slightly.

Suggest reverting http://github.com/FreeCAD/FreeCAD/commi ... 81f4b0ea61 and try again?

If the original PR works for you maybe there should be a version conditional around the fix line.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: new boost warnings in master

Post by openBrain »

berniev wrote: Tue Sep 27, 2022 2:00 am If the original PR works for you maybe there should be a version conditional around the fix line.
A compiler conditional may also be a solution. MSVC already shown some different behavior from GCC or Clang in some situations.
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: new boost warnings in master

Post by berniev »

I understand the ideal place is in cmake. Too many C++ macros!! Or I see, you mean compiler-specific. Have to waait and see first if that is even relevant.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: new boost warnings in master

Post by wmayer »

Somewhere I read that add_compile_definitions(DEFINE) is equivalent to add_definitions(-DDEFINE). The function add_compile_definitions has been added with CMake 3.12 but the minimum supported version must be 3.10.

So, having a look at the CMake source code reveals:
add_definitions:
https://github.com/Kitware/CMake/blob/9 ... s.cxx#L232
https://github.com/Kitware/CMake/blob/9 ... nd.cxx#L13
https://github.com/Kitware/CMake/blob/9 ... .cxx#L1298
https://github.com/Kitware/CMake/blob/9 ... .cxx#L1280

add_compile_definitions:
https://github.com/Kitware/CMake/blob/9 ... s.cxx#L228
https://github.com/Kitware/CMake/blob/9 ... nd.cxx#L13
https://github.com/Kitware/CMake/blob/9 ... .cxx#L1347

So, it's apparently the same as

Code: Select all

set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} DEFINE)
but not add_definitions()
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: new boost warnings in master

Post by wmayer »

berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: new boost warnings in master

Post by berniev »

Oops. You already stated min version
Post Reply