Trying to get rid of C ++ upgrade warning

Whenever I include boost in my project, I get a million of these warnings. Does anyone know how I can get rid of warnings?

../depends \ push / configuration/abi_prefix.hpp(19): warning C4103: 'Depends \ impulse \ Config \ abi_prefix.hpp': alignment is changed after the inclusion of the header, maybe due to the lack of #pragma packaging (pop)

I know what #pragma can do to disable the warning, but I would like to know the reason for these warnings.

+4
source share
3 answers

The reason is that boost does not push / push these pragmas in every file that needs data packing. These # include a separate file that does push (abi_prefix.hpp), and then another (abo_suffix.hp) that pop does.

This allows them to reuse the same #pragma pack code everywhere, which is convenient because it can vary between compilers.

It is completely safe. After pressing the #pragma button, a pop panel appears, it is simply included from another file. Therefore, you should simply disable this error.

+6
source

Yes, you will get this from the #pragma pack directive in config / abi / msvc_prefix.hpp. This means that your standard packaging is by default not 8. This is pretty unusual, is it intentional? Errors due to differences in packaging can be a little difficult to diagnose.

+2
source

I found a way to get rid of this warning.

You need to edit the boost_1 _ ** \ boost \ config \ user.hpp file and uncomment the line using BOOST_DISABLE_ABI_HEADERS

So you should define in this file:

#define BOOST_DISABLE_ABI_HEADERS 

Once this is done, just build with bjam, as usual,.

Please see comments below for the dangers of this decision.

0
source

All Articles