Skip to content

Commit

Permalink
build: Silence gcc new/delete warnings for texturesys (AcademySoftwar…
Browse files Browse the repository at this point in the history
…eFoundation#3944)

Disable GCC warnings around mismatched new/delete for shared_texturesys
creation


Signed-off-by: Shootfast <markboo99@gmail.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
Co-authored-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
Shootfast and lgritz committed Aug 25, 2023
1 parent e015ae4 commit 6cbd1e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libtexture/texturesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ static const OIIO_SIMD4_ALIGN vbool4 channel_masks[5] = {
TextureSystem*
TextureSystem::create(bool shared, ImageCache* imagecache)
{
// Because the shared_texturesys is never deleted (by design)
// we silence the otherwise useful compiler warning on newer GCC versions
OIIO_PRAGMA_WARNING_PUSH
#if OIIO_GNUC_VERSION > 100000
OIIO_GCC_ONLY_PRAGMA(GCC diagnostic ignored "-Wmismatched-new-delete")
#endif
if (shared) {
// They requested a shared texture system. If a shared one already
// exists, just return it, otherwise record the new texture system
Expand All @@ -106,6 +112,7 @@ TextureSystem::create(bool shared, ImageCache* imagecache)
#if 0
std::cerr << "creating new ImageCache " << (void *)ts << "\n";
#endif
OIIO_PRAGMA_WARNING_POP
return ts;
}

Expand Down

0 comments on commit 6cbd1e8

Please sign in to comment.