You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "cbalint13 (via GitHub)" <gi...@apache.org> on 2023/10/17 11:27:45 UTC

[PR] [Minor] Fix compilation warnings for clang [tvm]

cbalint13 opened a new pull request, #15940:
URL: https://github.com/apache/tvm/pull/15940

   Fix compilation warnings for clang.
   
   ---
   
   The warnings was:
   ```
   BUILD/tvm/src/target/llvm/llvm_instance.cc:84:81: warning: reference to stack memory associated with parameter 'Obj' returned [-Wreturn-stack-address]
      84 |   friend ArrayRef<SubtargetFeatureKV>& featViewer(MCSubtargetInfo Obj) { return Obj.*Member; }
         |                                                                                 ^~~
   BUILD/tvm/src/target/llvm/llvm_instance.cc:833:49: 
    warning: cast from 'const llvm::MCSubtargetInfo *' to 'llvm::MCSubtargetInfo *' drops const qualifier [-Wcast-qual]
     833 |       llvm::featViewer(*(llvm::MCSubtargetInfo*)MCInfo);
         |                                                 ^
   BUILD/tvm/src/target/llvm/llvm_instance.cc:84:81: 
    warning: reference to stack memory associated with parameter 'Obj' returned [-Wreturn-stack-address]
      84 |   friend ArrayRef<SubtargetFeatureKV>& featViewer(MCSubtargetInfo Obj) { return Obj.*Member; }
         |                                                                                 ^~~
   BUILD/tvm/src/target/llvm/llvm_instance.cc:833:13: note: in instantiation of member function 'llvm::featViewer' requested here
     833 |       llvm::featViewer(*(llvm::MCSubtargetInfo*)MCInfo);
         |           
   ```
   ```
   $ rpm -q clang
   clang-17.0.2-1.fc40.x86_64
   ```
   
   Cc: @junrushao 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "quic-sanirudh (via GitHub)" <gi...@apache.org>.
quic-sanirudh merged PR #15940:
URL: https://github.com/apache/tvm/pull/15940


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "cbalint13 (via GitHub)" <gi...@apache.org>.
cbalint13 commented on PR #15940:
URL: https://github.com/apache/tvm/pull/15940#issuecomment-1767289913

   @tvm-bot rerun


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "junrushao (via GitHub)" <gi...@apache.org>.
junrushao commented on PR #15940:
URL: https://github.com/apache/tvm/pull/15940#issuecomment-1767315738

   Hey @cbalint13 thanks a lot for the swift fix!! Yeah this issue was reported by clang++ on macOS, and I can confirm it’s gone with this change. Thanks again πŸ™


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "cbalint13 (via GitHub)" <gi...@apache.org>.
cbalint13 commented on PR #15940:
URL: https://github.com/apache/tvm/pull/15940#issuecomment-1767325750

   > Hey @cbalint13 thanks a lot for the swift fix!! Yeah this issue was reported by clang++ on macOS, and I can confirm it’s gone with this change. Thanks again πŸ™
   
   With pleasure, anytime.
   
   ---
   Just some extra info:
   
   I also checked using gcc's *"hardening"* stack-protector flags, being a default thing for fedora/redhat releng, and it is fine.
   
   Short, the very flag: ```-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong```
   
   The full flags, added by rhel/fedora [at packaging creation time](https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/buildflags.md):
   ```
   $ rpm --eval %{optflags}
   -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall 
   -Wno-complain-wrong-lang -Werror=format-security -Werror=implicit-function-declaration 
   -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS 
   -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
   -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic 
   -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer 
   -mno-omit-leaf-frame-pointer
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "cbalint13 (via GitHub)" <gi...@apache.org>.
cbalint13 commented on PR #15940:
URL: https://github.com/apache/tvm/pull/15940#issuecomment-1768705632

   @tvm-bot rerun


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Minor] Fix compilation warnings for clang [tvm]

Posted by "junrushao (via GitHub)" <gi...@apache.org>.
junrushao commented on PR #15940:
URL: https://github.com/apache/tvm/pull/15940#issuecomment-1769202148

   Thanks for testing with the extra stack protector πŸ™β€οΈ Let's get it merged soon!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org