Skip to content

Commit

Permalink
Fix gcc9 and gcc10 warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Jun 5, 2020
1 parent 404db11 commit 114321d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/liboslcomp/osllex.l
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/liboslexec/constfold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -2894,6 +2898,9 @@ DECLFOLDER(constfold_noise)
return 1;
}
}
#if OIIO_GNUC_VERSION >= 90000
# pragma GCC diagnostic pop
#endif

return 0;
}
Expand Down

0 comments on commit 114321d

Please sign in to comment.