ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.12k stars 500 forks source link

version: detects clang as MSVC and GCC #1446

Closed gotschmarcel-ni closed 1 year ago

gotschmarcel-ni commented 1 year ago

sol uses __GNUC__ to detect GCC and _MSC_VER to detect MSVC. The problem is that clang defines both of them.

ThePhD commented 1 year ago

This is fine. We want this to happen: you can know if it's a mixed-clang by checking SOL_IS_ON(SOL_COMPILER_VCXX) with SOL_IS_ON(SOL_COMPILER_CLANG), same with GCC.

Albeit, we should probably improve the GCC detection to be a lot more specific to GCC so it doesn't fire on Clang.

ThePhD commented 1 year ago

Ah, no. It's fine as is. If there's any place where we should specifically be checking for Clang first before GCC, that might help push me in one direction or another.

gotschmarcel-ni commented 1 year ago

I don't remember the exact error right now, but for us this was causing compile errors.

gotschmarcel-ni commented 1 year ago

Just compiled again w/o our local patch and we get the following error. Note besides, we use -Werror

sol-v3.3.0/include/sol/stack_check_get_qualified.hpp:35:32: error: unknown warning group '-Wmaybe-uninitialized', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"