Use diagnostic push and pop when suppressing GCC warnings to prevent suppressions from impacting code outside of ETL (#99)

This commit is contained in:
Austin Morton 2018-09-21 02:34:16 -04:00 committed by John Wellbelove
parent ece332630d
commit fb3d4d78fa
3 changed files with 16 additions and 1 deletions

View File

@ -54,6 +54,7 @@ SOFTWARE.
#define ETL_FILE "27"
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
@ -2232,6 +2233,10 @@ namespace etl
#include "private/minmax_pop.h"
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic pop
#endif
#undef ETL_FILE
#endif

View File

@ -45,6 +45,7 @@ SOFTWARE.
#include "../stl/iterator.h"
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
@ -204,6 +205,10 @@ namespace etl
#include "minmax_pop.h"
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic pop
#endif
#undef ETL_IN_PVOIDVECTOR
#endif

View File

@ -59,7 +59,8 @@ SOFTWARE.
#endif
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
//*****************************************************************************
@ -1223,4 +1224,8 @@ namespace etl
#include "private/ivectorpointer.h"
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic pop
#endif
#endif