Skip to content

Commit

Permalink
Fixes to compile with clang 15 (#1586)
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Sep 27, 2022
1 parent 8417f8e commit 4ba1678
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Expand Up @@ -16,7 +16,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.

* A suitable **C++14 or C++17** compiler to build OSL itself, which may be any of:
- **GCC 6.1 or newer** (tested through gcc 12.1)
- Clang 3.4 or newer (tested through clang 14)
- Clang 3.4 or newer (tested through clang 15)
- Microsoft Visual Studio **2017 or newer**
- Intel C++ compiler icc **version 17 or newer** or LLVM-based icx compiler
**version 2022 or newer**.
Expand Down
12 changes: 6 additions & 6 deletions site/spi/Makefile-bits
Expand Up @@ -181,14 +181,14 @@ else ifeq (${platform}, macosx)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
USE_LIBCPLUSPLUS := 0
else ifeq (${COMPILER},clang11)
else ifeq (${COMPILER},clang14)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@11/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@11/bin/clang++
else ifeq (${COMPILER},clang12)
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++
else ifeq (${COMPILER},clang15)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@12/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@12/bin/clang++
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@15/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@15/bin/clang++
else ifeq (${COMPILER},clang)
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
else ifeq (${COMPILER},gcc)
Expand Down
4 changes: 4 additions & 0 deletions src/liboslcomp/oslgram.y
Expand Up @@ -28,6 +28,10 @@
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#if OSL_CLANG_VERSION >= 150000
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility push(hidden)
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/liboslexec/instance.cpp
Expand Up @@ -466,11 +466,9 @@ ShaderInstance::evaluate_writes_globals_and_userdata_params()
// userdata_params as accurately as we can based on what we know from
// the symbol overrides. This is very important to get instance merging
// working correctly.
int p = 0;
for (auto&& s : m_instoverrides) {
if (!s.lockgeom())
userdata_params(true);
++p;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/liboslexec/osogram.y
Expand Up @@ -27,6 +27,10 @@
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#if OSL_CLANG_VERSION >= 150000
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility push(hidden)
#endif
Expand Down

0 comments on commit 4ba1678

Please sign in to comment.