Steam 回调在 Linux / GCC 编译期间触发警告
Steam Callbacks Trigger Warning During Compile In Linux / GCC
我已经在 Steamworks 集成上工作了一段时间,每次我在 Linux 上编译时,我所有的回调都会触发此警告。 每个一个,所以有一堵墙。话虽如此,回调工作得很好。
module.h: In member function 'virtual void Steam::CCallbackInternal__steam_api_call_completed::Run(void*)':
module.h:667:18: warning: offsetof within non-standard-layout type 'Steam' is conditionally-supported [-Winvalid-offsetof]
667 | STEAM_CALLBACK(Steam, _steam_api_call_completed, SteamAPICallCompleted_t);
sdk/public/steam/steam_api_internal.h:39:58: note: in expansion of macro '_STEAM_CALLBACK_3'
39 | #define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED
| ^~~~~~~~~~~~~~~~
sdk/public/steam/steam_api_common.h:99:2: note: in expansion of macro '_STEAM_CALLBACK_SELECT'
99 | _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) )
| ^~~~~~~~~~~~~~~~~~~~~~
module.h:667:3: note: in expansion of macro 'STEAM_CALLBACK'
667 | STEAM_CALLBACK(Steam, _steam_api_call_completed, SteamAPICallCompleted_t);
| ^~~~~~~~~~~~~~
module.h: In member function 'virtual void Steam::CCallbackInternal__steam_shutdown::Run(void*)':
module.h:668:18: warning: offsetof within non-standard-layout type 'Steam' is conditionally-supported [-Winvalid-offsetof]
668 | STEAM_CALLBACK(Steam, _steam_shutdown, SteamShutdown_t);
sdk/public/steam/steam_api_internal.h:39:58: note: in expansion of macro '_STEAM_CALLBACK_3'
39 | #define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED
| ^~~~~~~~~~~~~~~~
sdk/public/steam/steam_api_common.h:99:2: note: in expansion of macro '_STEAM_CALLBACK_SELECT'
99 | _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) )
| ^~~~~~~~~~~~~~~~~~~~~~
module.h:668:3: note: in expansion of macro 'STEAM_CALLBACK'
668 | STEAM_CALLBACK(Steam, _steam_shutdown, SteamShutdown_t);
当回调工作时,想知道是什么导致了这些警告以及如何修复它们。
我正在使用GCC/G ++ 9.2.1在Ubuntu Linux 19.10中进行编译,以供参考。
我不得不让他们沉默
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
// my code
#pragma GCC diagnostic pop
相关文章:
- 关于std::move的使用,是否有编译警告
- 示例C++项目编译中的警告
- Steam 回调在 Linux / GCC 编译期间触发警告
- C++警告:编译指示在主文件中一次
- 如何在类成员函数中获得类似printf中的编译警告
- 编译按位 OR 时出现警告 C4805
- C++编译新的警告过滤器
- GCC 编译时出现警告:未知转义序列:"\040"
- 使用预编译的标题接近时,大量的QT警告
- 编译时收到未初始化的内存警告
- 警告:不能解析.gnu_debugdata部分;LZMA支持在编译时被禁用
- 编译错误:(警告:控制到达非空函数 [-wreturn 类型] 的末尾)
- clang:警告:编译期间未使用的参数:"-stdlib=libc++"
- 如何修复未知编译指示 gcc 警告
- 有没有办法自定义编译错误/警告消息
- 窄转换编译警告.如何解决它
- C++就地析构函数编译警告
- 如何在 ubuntu 12.10 中隐藏 g++ c++11 编译警告
- 在Ubuntu中使用OpenCV进行编译警告
- 警告:编译到.so时找不到入口符号start-