From 114321d00291b97eb1c2f4232f89efa2ef13a341 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Thu, 4 Jun 2020 18:50:16 -0700 Subject: [PATCH] Fix gcc9 and gcc10 warnings Signed-off-by: Larry Gritz --- src/liboslcomp/osllex.l | 8 ++++++++ src/liboslexec/constfold.cpp | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/liboslcomp/osllex.l b/src/liboslcomp/osllex.l index a3338d6b3..02e0052ca 100644 --- a/src/liboslcomp/osllex.l +++ b/src/liboslcomp/osllex.l @@ -125,6 +125,14 @@ using namespace OSL::pvt; #pragma GCC diagnostic ignored "-Wsign-compare" #endif +// flex uses the 'register' keyword, warned because it's deprecated in C++17. +#if defined(__clang__) +#pragma GCC diagnostic ignored "-Wdeprecated-register" +#endif +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Wregister" +#endif + void preprocess (const char *yytext); // Macro that sets the yylloc line variables to the current parse line. diff --git a/src/liboslexec/constfold.cpp b/src/liboslexec/constfold.cpp index 940839576..b9d6925cf 100644 --- a/src/liboslexec/constfold.cpp +++ b/src/liboslexec/constfold.cpp @@ -2863,6 +2863,10 @@ DECLFOLDER(constfold_noise) return 0; // optional args starting, we don't fold them yet } +#if OIIO_GNUC_VERSION >= 90000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif if (name == u_cellnoise || name == u_cell) { CellNoise cell; if (outdim == 1) { @@ -2894,6 +2898,9 @@ DECLFOLDER(constfold_noise) return 1; } } +#if OIIO_GNUC_VERSION >= 90000 +# pragma GCC diagnostic pop +#endif return 0; }