From 56ab717ff35579e8468d7617162c1b7f46fd2b68 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 30 Jul 2016 21:23:57 +0100 Subject: Test case warning fixes for nodejs nodejs 4.2.1 on Ubuntu Xenial Xerus --- Examples/test-suite/cpp_enum.i | 6 ++++++ Examples/test-suite/enum_thorough.i | 6 ++++++ Examples/test-suite/enums.i | 6 ++++++ Examples/test-suite/nested.i | 12 ++++++++++++ Examples/test-suite/nested_extend_c.i | 12 ++++++++++++ Examples/test-suite/nested_structs.i | 12 ++++++++++++ Examples/test-suite/typedef_struct.i | 7 +++++++ 7 files changed, 61 insertions(+) diff --git a/Examples/test-suite/cpp_enum.i b/Examples/test-suite/cpp_enum.i index cb212615a..548c65de4 100644 --- a/Examples/test-suite/cpp_enum.i +++ b/Examples/test-suite/cpp_enum.i @@ -6,6 +6,12 @@ The primary purpose of this testcase is to ensure that enums used along with the %inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for anonymous enums */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + enum SOME_ENUM {ENUM_ONE, ENUM_TWO}; struct StructWithEnums { diff --git a/Examples/test-suite/enum_thorough.i b/Examples/test-suite/enum_thorough.i index 66189fbe2..fd5978102 100644 --- a/Examples/test-suite/enum_thorough.i +++ b/Examples/test-suite/enum_thorough.i @@ -47,6 +47,12 @@ %inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for anonymous enums */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + enum { AnonEnum1, AnonEnum2 = 100 }; enum { ReallyAnInteger = 200 }; //enum { AnonEnum3, AnonEnum4 } instance; diff --git a/Examples/test-suite/enums.i b/Examples/test-suite/enums.i index 14c6efbba..b8ffd7588 100644 --- a/Examples/test-suite/enums.i +++ b/Examples/test-suite/enums.i @@ -12,6 +12,12 @@ %inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for anonymous enums */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + typedef enum { CSP_ITERATION_FWD, CSP_ITERATION_BWD = 11 diff --git a/Examples/test-suite/nested.i b/Examples/test-suite/nested.i index 1d4710128..216ee4224 100644 --- a/Examples/test-suite/nested.i +++ b/Examples/test-suite/nested.i @@ -13,6 +13,18 @@ Also tests reported error when a #define placed in a deeply embedded struct/unio %rename(InUnNamed) OuterStructNamed::Inner_union_named; #endif +#if defined(SWIG_JAVASCRIPT_V8) + +%inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for nested C class wrappers compiled as C++ code */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif +%} + +#endif + %inline %{ struct TestStruct { diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index 032619f8e..f1d7ff2c8 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -1,5 +1,17 @@ %module nested_extend_c +#if defined(SWIG_JAVASCRIPT_V8) + +%inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for nested C class wrappers compiled as C++ code */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif +%} + +#endif + #if !defined(SWIGOCTAVE) && !defined(SWIG_JAVASCRIPT_V8) %extend hiA { hiA() { diff --git a/Examples/test-suite/nested_structs.i b/Examples/test-suite/nested_structs.i index f4f7a275a..c70924958 100644 --- a/Examples/test-suite/nested_structs.i +++ b/Examples/test-suite/nested_structs.i @@ -1,5 +1,17 @@ %module nested_structs +#if defined(SWIG_JAVASCRIPT_V8) + +%inline %{ +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for nested C class wrappers compiled as C++ code */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif +%} + +#endif + // bug #491476 %inline %{ struct Outer { diff --git a/Examples/test-suite/typedef_struct.i b/Examples/test-suite/typedef_struct.i index 97456d9a6..185e81105 100644 --- a/Examples/test-suite/typedef_struct.i +++ b/Examples/test-suite/typedef_struct.i @@ -1,6 +1,13 @@ %module typedef_struct %inline %{ + +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +/* for anonymous enums */ +/* dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + typedef struct { int numpoints; } LineObj; -- cgit v1.2.1