File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232// //////////////////////////////////////////////////////////////////////////////
3333
34+ /* Using offsetof() on a non-POD type (e.g. structs with inheritance
35+ * and classes) is, strictly-speaking, undefined according to the C++
36+ * standard (because C++'s offsetof is only present for C
37+ * compatibility and is only defined for operations on C types).
38+ * Disable GCC's offsetof warnings for these macros */
39+ #pragma GCC diagnostic push
40+ #pragma GCC diagnostic ignored "-Winvalid-offsetof"
41+
3442MC_PICKLE_BEGIN_RECORD (MCScriptDefinedType)
3543 MC_PICKLE_UINDEX(index)
3644MC_PICKLE_END_RECORD()
@@ -177,6 +185,9 @@ MC_PICKLE_BEGIN_RECORD(MCScriptModule)
177185 MC_PICKLE_ARRAY_OF_RECORD(MCScriptPosition, positions, position_count)
178186MC_PICKLE_END_RECORD()
179187
188+ /* Re-enable invalid-offsetof warnings */
189+ #pragma GCC diagnostic pop
190+
180191// //////////////////////////////////////////////////////////////////////////////
181192
182193static MCScriptModule *s_modules = nil;
You can’t perform that action at this time.
0 commit comments