Skip to content

GCC warning -Wunused-but-set-parameter in MLIR (<gcc-10 only) #68409

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

Closed
lipracer opened this issue Oct 6, 2023 · 3 comments
Closed

GCC warning -Wunused-but-set-parameter in MLIR (<gcc-10 only) #68409

lipracer opened this issue Oct 6, 2023 · 3 comments

Comments

@lipracer
Copy link
Member

lipracer commented Oct 6, 2023

system:
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

summary:

llvm-project/mlir/include/mlir/IR/OperationSupport.h:656:67: warning: parameter ‘rhs’ set but not used [-Wunused-but-set-parameter]
  656 |     bool compareProperties(OpaqueProperties lhs, OpaqueProperties rhs) final {
      |                                                  ~~~~~~~~~~~~~~~~~^~~
llvm-project/mlir/include/mlir/IR/OperationSupport.h: In instantiation of ‘llvm::hash_code mlir::RegisteredOperationName::Model<ConcreteOp>::hashProperties(mlir::OpaqueProperties) [with ConcreteOp = mlir::transform::ApplyExpandOpsPatternsOp]’:
llvm-project/mlir/include/mlir/IR/OperationSupport.h:666:21:   required from here
llvm-project/mlir/include/mlir/IR/OperationSupport.h:666:53: warning: parameter ‘prop’ set but not used [-Wunused-but-set-parameter]
  666 |     llvm::hash_code hashProperties(OpaqueProperties prop) final {
@github-actions github-actions bot added the mlir label Oct 6, 2023
@joker-eph
Copy link
Collaborator

This is a gcc issue fixed in gcc 10 I believe: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827
not sure we should fix it? If someone is interested I would suggest writing a CMake patch that detects gcc < 10 and sets -Wnounused-but-set-parameter flag.

@joker-eph joker-eph changed the title Too many warning messages during mlir build process GCC warning -Wunused-but-set-parameter in MLIR (<gcc-10 only) Oct 6, 2023
@lipracer
Copy link
Member Author

lipracer commented Oct 8, 2023

Thanks, I will create a PR later.

@lipracer
Copy link
Member Author

lipracer commented Oct 9, 2023

cmake patch PR.

lipracer added a commit to lipracer/llvm-project that referenced this issue Oct 10, 2023
also remove `comparison of unsigned expression >= 0`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants