File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 4848 #define ARCH_PRAGMA_UNUSED_FUNCTION \
4949 _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
5050
51+ #define ARCH_PRAGMA_STRINGOP_OVERFLOW \
52+ _Pragma("GCC diagnostic ignored \"-Wstringop-overflow=\"")
53+
5154#elif defined(ARCH_COMPILER_CLANG )
5255
5356 #define ARCH_PRAGMA_PUSH \
181184 #define ARCH_PRAGMA_UNUSED_FUNCTION
182185#endif
183186
187+ #if !defined ARCH_PRAGMA_STRINGOP_OVERFLOW
188+ #define ARCH_PRAGMA_STRINGOP_OVERFLOW
189+ #endif
190+
184191#if !defined ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
185192 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
186193#endif
Original file line number Diff line number Diff line change 5353
5454#include " pxr/base/arch/defines.h"
5555#include " pxr/base/arch/fileSystem.h"
56+ #include " pxr/base/arch/pragmas.h"
5657
5758#include < cstdio>
5859#include < cmath>
@@ -505,6 +506,9 @@ static void testArray() {
505506 // Test that attempts to create overly large arrays throw
506507 // std::bad_alloc
507508
509+ ARCH_PRAGMA_PUSH
510+ ARCH_PRAGMA_STRINGOP_OVERFLOW
511+
508512 VtIntArray ia;
509513 try {
510514 ia.resize (std::numeric_limits<size_t >::max ());
@@ -530,6 +534,8 @@ static void testArray() {
530534 catch (std::bad_alloc const &) {
531535 // pass
532536 }
537+
538+ ARCH_PRAGMA_POP
533539 }
534540}
535541
You can’t perform that action at this time.
0 commit comments