Skip to content

Commit 248b3f9

Browse files
committed
Removed __extension__, disabled warning for anonymous structs
1 parent a120054 commit 248b3f9

17 files changed

Lines changed: 19 additions & 18 deletions

File tree

common/cmake/clang.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ ELSE()
101101
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal") # disable: intentional exact-zero checks in normalize_safe
102102
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow") # disable: pervasive in vector class constructors
103103
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types") # disable: anonymous types in unions for SIMD
104+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-anonymous-struct") # disable: anonymous structs in unions for SIMD
104105
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare") # disable: int/size_t comparisons in template code
105106
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++17-attribute-extensions") # disable: [[fallthrough]] etc in C++11 mode
106107
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") # treat all warnings as errors

common/cmake/gnu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ ENDIF (EMBREE_ARM)
3434

3535
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
3636
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") # enables extra warnings
37-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") # enables pedantic warnings
3837
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
3938
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess") # disables clearing an object of type
4039
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") # disables warnings for unused function parameters
@@ -54,6 +53,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-align") # disable:
5453
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-declarations") # disable: intentional factory pattern without declarations
5554
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow") # disable: pervasive in vector class constructors
5655
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal") # disable: intentional exact-zero checks in normalize_safe
56+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types") # disable: anonymous types in unions for SIMD
5757
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wredundant-decls") # warn about redundant declarations
5858
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
5959

common/math/color.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace embree
2323
{
2424
union {
2525
__m128 m128;
26-
__extension__ struct { float r,g,b,a; };
26+
struct { float r,g,b,a; };
2727
};
2828

2929
////////////////////////////////////////////////////////////////////////////////
@@ -91,7 +91,7 @@ namespace embree
9191
{
9292
union {
9393
__m128 m128;
94-
__extension__ struct { float r,g,b; };
94+
struct { float r,g,b; };
9595
};
9696

9797
////////////////////////////////////////////////////////////////////////////////

common/math/vec2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace embree
1717
{
1818
enum { N = 2 };
1919
union {
20-
__extension__ struct { T x, y; };
20+
struct { T x, y; };
2121
#if !(defined(__WIN32__) && _MSC_VER == 1800) // workaround for older VS 2013 compiler
2222
T components[N];
2323
#endif

common/math/vec2fa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace embree
2626
enum { N = 2 };
2727
union {
2828
__m128 m128;
29-
__extension__ struct { float x,y,az,aw; };
29+
struct { float x,y,az,aw; };
3030
};
3131

3232
////////////////////////////////////////////////////////////////////////////////

common/math/vec3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace embree
1818
enum { N = 3 };
1919

2020
union {
21-
__extension__ struct {
21+
struct {
2222
T x, y, z;
2323
};
2424
#if !(defined(__WIN32__) && _MSC_VER == 1800) // workaround for older VS 2013 compiler

common/math/vec3ba.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace embree
2424

2525
union {
2626
__m128 m128;
27-
__extension__ struct { int x,y,z; };
27+
struct { int x,y,z; };
2828
};
2929

3030
typedef int Scalar;

common/math/vec3fa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace embree
2626
enum { N = 3 };
2727
union {
2828
__m128 m128;
29-
__extension__ struct { float x,y,z; };
29+
struct { float x,y,z; };
3030
};
3131

3232
////////////////////////////////////////////////////////////////////////////////
@@ -429,7 +429,7 @@ namespace embree
429429
enum { N = 3 };
430430
union {
431431
__m128 m128;
432-
__extension__ struct { float x,y,z; union { int a; unsigned u; float w; }; };
432+
struct { float x,y,z; union { int a; unsigned u; float w; }; };
433433
};
434434

435435
////////////////////////////////////////////////////////////////////////////////

common/math/vec3ia.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace embree
2424

2525
union {
2626
__m128i m128;
27-
__extension__ struct { int x,y,z; };
27+
struct { int x,y,z; };
2828
};
2929

3030
typedef int Scalar;

common/math/vec4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace embree
1616
{
1717
enum { N = 4 };
1818
union {
19-
__extension__ struct { T x, y, z, w; };
19+
struct { T x, y, z, w; };
2020
#if !(defined(__WIN32__) && _MSC_VER == 1800) // workaround for older VS 2013 compiler
2121
T components[N];
2222
#endif

0 commit comments

Comments
 (0)