Suspicious warning for fake int in PreviewLoader.cpp

Stephan Witt st.witt at gmx.net
Thu Dec 15 22:02:20 UTC 2022


Hi all,

I’m seeing this warning with more modern Apple compilers for lyx-2.3.x:

lyx-2.3.x/src/graphics/PreviewLoader.cpp:730:28: warning: result of '2^20' is 22; did you mean '1 << 20' (1048576)? [-Wxor-used-as-pow]
                static atomic_int fake((2^20) + 1);
                                        ~^~~
                                        1 << 20
lyx-2.3.x/src/graphics/PreviewLoader.cpp:730:28: note: replace expression with '0x2 ^ 20' or use 'xor' instead of '^' to silence this warning

This was fixed in master. Shouldn’t the fix be backport to 2.3.x?

Stephan


More information about the lyx-devel mailing list