palacaze / sigslot

A simple C++14 signal-slots implementation
MIT License
709 stars 97 forks source link

Avoid warnings about undefined __GNUC__ with non-gcc compilers #29

Closed vadz closed 2 years ago

vadz commented 2 years ago

Check that GNUC is defined before testing its value to avoid the equivalent of gcc -Wundef with other compilers, notably MSVC.


No real changes, but just a very minor fix to avoid this MSVC warning (which is disabled by default but that I enable for all my code, as it's quite useful fore detecting typos etc).

vadz commented 2 years ago

AFAICS the CI build failures have nothing to do with my (trivial) change.

palacaze commented 2 years ago

Hi, thanks for the PR. Yes, the failure happens in the CI. I have a tentative fix for it, but now I see a test failure on Windows. I will try to fix this failure first.

palacaze commented 2 years ago

While fixing the bug triggering a test failure I got rid of this piece of code, so the PR is not needed anymore.

vadz commented 2 years ago

Thanks, but testing the latest master with MSVC now results in

sigslot\include\sigslot\signal.hpp(203,72): warning C4324: 'sigslot::detail::func_ptr': structure was padded due to alignment specifier

I think this warning is harmless, but it would be nice to disable it. Should I make another PR to do it or will you do it yourself?

palacaze commented 2 years ago

Does the warning stop when exchanging the sz and data member variables in func_ptr?

vadz commented 2 years ago

Does the warning stop when exchanging the sz and data member variables in func_ptr?

Yes indeed, exchanging these lines fixes the warning.

palacaze commented 2 years ago

Ok thanks for the test, I will fix this tomorrow.