Clang settings ? #577
Practical-UVM-Step-By-Step
started this conversation in
General
Replies: 2 comments
-
No, the comment is just to turn off auto-formatting, it doesn't affect the compiler in any way. slang builds under Xcode 13, not sure if it will build with earlier versions. Unfortunately Apple ties Xcode releases to OS updates, so if you want to keep using Xcode you may be forced to upgrade to get a more modern compiler. Alternatively you can always install clang separately via homebrew or whatever and build that way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello:
on OSX Catalina:
is this clang-format off supposed to be a compiler ifdef? seeing some errors like below.
Basically a virgin checkout, cmake .. -G XCode and opened the generated project to build.
// clang-format off
#define TU(x)
x(Seconds)
x(Milliseconds)
x(Microseconds)
x(Nanoseconds)
x(Picoseconds)
x(Femtoseconds)
/// Scale unit for a time value.
ENUM_SIZED(TimeUnit, uint8_t, TU). // Error on Line 23 in Time.h : Constexpr variable 'values' must be initialized by a constant expression
#undef TU
// clang-format on
From the log:
[build] /Volumes/Workarea/slang/source/../include/slang/diagnostics/Diagnostics.h:41:1: note: temporary created here
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:30:38: note: expanded from macro 'ENUM_SIZED'
[build] static constexpr auto vals = { elements(UTIL_ENUM_ELEMENT) };
[build] ^
[build] In file included from /Volumes/Workarea/slang/source/diagnostics/TextDiagnosticClient.cpp:7:
[build] In file included from /Volumes/Workarea/slang/source/../include/slang/diagnostics/TextDiagnosticClient.h:12:
[build] In file included from /Volumes/Workarea/slang/source/../include/slang/diagnostics/DiagnosticClient.h:9:
[build] In file included from /Volumes/Workarea/slang/source/../include/slang/diagnostics/DiagnosticEngine.h:14:
[build] /Volumes/Workarea/slang/source/../include/slang/diagnostics/Diagnostics.h:52:1: error: constexpr variable 'values' must be initialized by a constant expression
[build] ENUM(DiagnosticSeverity, DS)
[build] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:18:30: note: expanded from macro 'ENUM'
[build] #define ENUM(name, elements) ENUM_SIZED(name, int, elements)
[build] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:42:88: note: expanded from macro 'ENUM_SIZED'
[build] inline constexpr const std::array<name, name##_traits::vals.size()> name##_traits::values =
[build] ^
[build] /Volumes/Workarea/slang/source/../include/slang/diagnostics/Diagnostics.h:52:1: note: read of temporary is not allowed in a constant expression outside the expression that created the temporary
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:18:30: note: expanded from macro 'ENUM'
[build] #define ENUM(name, elements) ENUM_SIZED(name, int, elements)
[build] ^
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:34:27: note: expanded from macro 'ENUM_SIZED'
[build] for (auto val : vals)
[build] ^
[build] /Volumes/Workarea/slang/source/../include/slang/diagnostics/Diagnostics.h:52:1: note: in call to 'getValues()'
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:18:30: note: expanded from macro 'ENUM'
[build] #define ENUM(name, elements) ENUM_SIZED(name, int, elements)
[build] ^
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:43:9: note: expanded from macro 'ENUM_SIZED'
[build] getValues();
[build] ^
[build] /Volumes/Workarea/slang/source/../include/slang/diagnostics/Diagnostics.h:52:1: note: temporary created here
[build] /Volumes/Workarea/slang/source/../include/slang/util/Enum.h:18:30: note: expanded from macro 'ENUM'
[build] #define ENUM(name, elements) ENUM_SIZED(name, int, elements)
Beta Was this translation helpful? Give feedback.
All reactions