Skip to content

Add no-unused-but-set-parameter to skip verbose warning #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 13, 2024

Conversation

Menooker
Copy link

@Menooker Menooker commented May 6, 2024

I received the following warning messages many times while compiling. g++ version 9.4.0

/home/shared/bin/mlir/20240505/include/mlir/IR/Attributes.h: In instantiation of ‘static bool llvm::CastInfo<To, From, typename std::enable_if<(is_same_v<mlir::Attribute, typename std::remove_const<From>::type> || is_base_of_v<mlir::Attribute, From>), void>::type>::isPossible(mlir::Attribute) [with To = mlir::Attribute; From = mlir::Attribute]’:
/home/shared/bin/mlir/20240505/include/llvm/Support/Casting.h:311:29:   required from ‘static To llvm::DefaultDoCastIfPossible<To, From, Derived>::doCastIfPossible(From) [with To = mlir::Attribute; From = mlir::Attribute; Derived = llvm::CastInfo<mlir::Attribute, mlir::Attribute, void>]’
/home/shared/bin/mlir/20240505/include/llvm/Support/Casting.h:657:46:   required from ‘decltype(auto) llvm::dyn_cast(From&) [with To = mlir::Attribute; From = mlir::Attribute]’
/home/shared/bin/mlir/20240505/include/mlir/IR/OpImplementation.h:972:38:   required from ‘mlir::ParseResult mlir::AsmParser::parseAttribute(AttrType&, mlir::Type, llvm::StringRef, mlir::NamedAttrList&) [with AttrType = mlir::Attribute]’
/home/shared/bin/mlir/20240505/include/mlir/IR/OpImplementation.h:948:58:   required from here
/home/shared/bin/mlir/20240505/include/mlir/IR/Attributes.h:417:49: warning: parameter ‘ty’ set but not used [-Wunused-but-set-parameter]
  417 |   static inline bool isPossible(mlir::Attribute ty) {

This PR disables the warnings for non-MSVC builds.

@kurapov-peter
Copy link
Contributor

@Menooker, is it for MLIR build? If so, I'd suggest we set the flag for the target only and use stricter rules for our code.

@kurapov-peter kurapov-peter self-requested a review May 6, 2024 11:16
@Menooker
Copy link
Author

Menooker commented May 7, 2024

@Menooker, is it for MLIR build? If so, I'd suggest we set the flag for the target only and use stricter rules for our code.

Yes, it is for MLIR only. I have updated the code to let the CXX flag only affect on MLIR targets only.

@Menooker Menooker force-pushed the yijie/no-unused-but-set-parameter branch from 39321c1 to 17a532e Compare May 7, 2024 08:54
@Menooker Menooker requested a review from ZhennanQin May 9, 2024 02:39
# cases, by marking SelectedCase as used. See
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is
# fixed in GCC 10.
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines are copied from MLIR upstream. They have the same issue too.

Mei, Yijie added 2 commits May 13, 2024 10:51
@Menooker Menooker merged commit 72b8af4 into intel:main May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants