[Bug 245006] toolchain: clang issues bogus "warning: multi-line // comment [-Wcomment]" under -pedantic

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Mar 23 21:34:57 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245006

Matthias Andree <mandree at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.llvm.org/show_
                   |                            |bug.cgi?id=45285
            Summary|toolchain: clang issues     |toolchain: clang issues
                   |bogus "warning: multi-line  |bogus "warning: multi-line
                   |// comment [-Wcomment]"     |// comment [-Wcomment]"
                   |                            |under -pedantic

--- Comment #4 from Matthias Andree <mandree at FreeBSD.org> ---
After some digging, I figured that -pedantic -std=c11 makes the difference. 
All GCC version I've tried (9.2.0, 10.0 snapshot) accept the code without
diagnostics. 

-pedantic interpretation differs. clang flags extensions, and gcc enables all
diagnostics required by the standard.


gcc -O -std=c11 -pedantic-errors  -c /tmp/try.c 
gcc10 -O -std=c11 -pedantic-errors  -c /tmp/try.c 
(no output)

clang -O -std=c11 -pedantic-errors  -c /tmp/try.c 
/tmp/try.c:1:4: error: multi-line // comment [-Werror,-Wcomment]

same for base clang and all clang versions from ports:
llvm-devel-11.0.d20200117      LLVM and Clang
llvm10-10.0.0.r4               LLVM and Clang
llvm80-8.0.1_3                 LLVM and Clang
llvm90-9.0.1                   LLVM and Clang

I've filed this with LLVM, link in See Also. Let's see what we get.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-toolchain mailing list