Repository navigation
clang doesn't emit the same warnings for global variables #92
Description
Activity
- added[BUG] llvmA bug that should be fixed in upstream LLVMA bug that should be fixed in upstream LLVM
on Sep 17, 2018 - added a commit that references this issue
on Mar 7, 2019 I plan on revisiting this later this quarter.
Posting what @zygoloid sent me about this:
I think it should not require major invasive changes to Clang to fix this. While we can't built a CFG for the initializer of a global variable, we don't really need to, since there's never any control flow there (you can't have a statement-expression at global scope). So we could just walk the initializer after attaching it, skip obviously-dead branches in ?: expressions, and emit deferred runtime-behavior diagnostics for the rest. (And ideally we'd skip all of that if we don't have any pending runtime-behavior diagnostics when we reach the end of a global's initializer.)
- added[PATCH] SubmittedA patch has been submitted for reviewA patch has been submitted for review
on Jul 21, 2019 - added a commit that references this issue
on Sep 18, 2019 - addedlow priorityThis bug is not critical and not a priorityThis bug is not critical and not a priority
on Feb 8, 2020 - addedlow priorityThis bug is not critical and not a priorityThis bug is not critical and not a priorityand removedlow priorityThis bug is not critical and not a priorityThis bug is not critical and not a priority
on Apr 23, 2020 - added a commit that references this issue
on Jun 7, 2020 - added a commit that references this issue
on Jul 31, 2020 12 remaining items
- added a commit that references this issue
on Oct 15, 2025 - added a commit that references this issue
on Oct 22, 2025 - added a commit that references this issue
on Oct 22, 2025 This issue was auto-closed by virtue of a
Fixes:tag in the LLVM PR but I think this should only be closed once LLVM cuts a release that includes the fix and we can verify these sorts of warnings aren't popping up anymore.Up to you though @nathanchance
- added[FIXED][LLVM] 22This bug was fixed in LLVM 22This bug was fixed in LLVM 22and removed[PATCH] BitrotPatch is outdated and needs to be refreshed or revisitedPatch is outdated and needs to be refreshed or revisited
on Nov 11, 2025 We historically have closed an issue whenever it is fixed in
mainwith aFIXED LLVMlabel for the version we expect it to be released in, so I think we can just do that here (since there is not anything else for us to do about this problem other than continuing to work around the issue in the kernel for older versions of clang when necessary).- added a commit that references this issue
on Apr 21, 2026 - added a commit that references this issue
on Jun 24, 2026
https://llvm.org/pr38789