[llvm-bugs] [Bug 37350] Old cast warning in Extern "C" code.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 7 10:16:58 PDT 2018


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

Tim Northover <t.p.northover at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |t.p.northover at gmail.com

--- Comment #1 from Tim Northover <t.p.northover at gmail.com> ---
> But since it is inside a section of code that is declared as C, I don't think that there should be any warning.

This isn't what 'extern "C"' means. It changes the low-level name of functions
so that they can be conveniently called from C code, but the source inside an
'extern "C"' block is still normal C++. It can use the usual C++ style casts
and there's no more (or less) reason to prefer the old-style ones.

Also, this warning has to be enabled manually (it's not even in -Wall) so I see
no reason to change its behaviour inside that kind of block.

-- 
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/20180507/0b192da3/attachment.html>


More information about the llvm-bugs mailing list