C++ -malign-double compiler flag

前端 未结 3 619
粉色の甜心
粉色の甜心 2021-01-19 09:07

I need some help on compiler flags in c++. I\'m using a library that is a port to linux from windows, that has to be compiled with the -malign-double flag, \"for Win32 compa

3条回答
  •  清歌不尽
    2021-01-19 09:38

    That's a great flag name! I wonder if there is also a -malign-influence? But seriously this flag controls a slight optimisation:

    -malign-double

    -mno-align-double

    Control whether GCC aligns double, long double,and long long variables on a two word boundary or a one word boundary.Aligning double variables on a two word boundary will produce codethat runs somewhat faster on a ‘Pentium’ at the expense of more memory.

    It's unlikely that either the library or your code needs this flag. In general, you should not be using alignment control flags, unless you know exactly what you are doing. If you do feel you need to use them, consult the GCC manual at http://gcc.gnu.org/onlinedocs.

提交回复
热议问题