[llvm] Warn on align directive with non-zero fill value in virtual sections (PR #66792)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 17:19:50 PDT 2023


================
@@ -12,5 +12,8 @@
 # CHECK: {{.*}}.s:[[#@LINE+1]]:3: error: SHT_NOBITS section '.bss' cannot have instructions
   addb %al,(%rax)
 
+# CHECK: {{.*}}.s:[[#@LINE+1]]:11: warning: ignoring non-zero fill value in SHT_NOBITS section '.bss'
+.align 4, 42
+
----------------
s-barannikov wrote:

`Warning()` returns true (indicating an error) only in presense of `--fatal-warnings`. We might want to add the `--fatal-warnings` check to test that we didn't forget `ReturnVal |=` part. (However, it appears that omitting it does not change the behavior because top-level loop not only checks for the return value, but also for what `hasPendingErrors()` returns.)
Regarding `--no-warn`, I tend to agree with you.


https://github.com/llvm/llvm-project/pull/66792


More information about the llvm-commits mailing list