[llvm-bugs] [Bug 51931] -Wdeclaration-after-statement doesn't work when used with -std=c99

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 21 14:13:28 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51931

David Blaikie <dblaikie at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |dblaikie at gmail.com

--- Comment #1 from David Blaikie <dblaikie at gmail.com> ---
This seems to be working as intended. The intent is to flag technically invalid
code (often triggered via -pedantic) but this code isn't invalid in the mode
you're building with (c99) - interleaved declarations and definitions are OK
there.

GCC implements this the same way by the looks of it:
https://godbolt.org/z/bExKrhs6M

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210921/9dc1138a/attachment.html>


More information about the llvm-bugs mailing list