Add -Wunused to default Triton builds#10267
Conversation
|
IMO adding warnings is kind of pointless because nobody looks at the logs. We should enable it as an error in CI if we want to keep it clean. |
We also enable |
peterbell10
left a comment
There was a problem hiding this comment.
Oh, somehow I didn't realise. I guess we must not have many warnings enabled then.
| const TypeConverter *typeConverter, | ||
| ConversionPatternRewriter &rewriter, | ||
| Location loc) { | ||
| static inline Value getOffsetedBase(Value v, gpu::MemDescType memDescTy, |
There was a problem hiding this comment.
static inline is a bit of an oxymoron. Should just be inline.
There was a problem hiding this comment.
static here is not completely redundant. It still gives the function internal linkage. In practice, this likely only really makes a difference when Triton plugins are enabled, since it will affect whether the function gets exported by libtriton.so.
| set(CMAKE_C_FLAGS_TRITONRELBUILDWITHASSERTS "-O2 -g") | ||
| set(CMAKE_CXX_FLAGS_TRITONRELBUILDWITHASSERTS "-O2 -g") | ||
| set(CMAKE_C_FLAGS_TRITONRELBUILDWITHASSERTS "-O2 -g -Wunused") | ||
| set(CMAKE_CXX_FLAGS_TRITONRELBUILDWITHASSERTS "-O2 -g -Wunused") |
There was a problem hiding this comment.
Why only for this build type?
There was a problem hiding this comment.
This is mostly so we don't break release builds with assertions disabled, since many variables may become unused if they are only used inside asserts.
Add `-Wunused` in the default build mode. This catches dead variables, fields, and functions. Setting it only in this mode avoids issues when switching between modes (e.g. release builds where vars only used in asserts become unused).
2bbfacc to
6ae9483
Compare
Add
-Wunusedin the default build mode. This catches dead variables,fields, and functions.
Setting it only in this mode avoids issues when switching between modes
(e.g. release builds where vars only used in asserts become unused).