<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.18269"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px" 
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT size=2 face=Consolas>On Tuesday, November 05, 2013 8:44 PM, Richard 
Smith wrote:<BR>> On Tue, Nov 5, 2013 at 11:19 AM, David Chisnall 
wrote:<BR>>> On 5 Nov 2013, at 18:19, Reid Kleckner wrote:<BR>>>> 
IMO extern "C" is a clear indication that the user wants to 
interoperate<BR>>>> between C and C++.  clang should have this 
warning on by default in<BR>>>> extern "C" 
contexts.<BR>>><BR>>> The problem is that the compiler only sees the 
extern "C" when compiling<BR>>> in C++ mode, but the author of the header 
most likely compiles<BR>>> predominantly in C mode.<BR>><BR>> I'm 
honestly not worried about this. If someone is writing a header that<BR>> 
they expect to be usable from language modes X, Y, and Z, and they 
neither<BR>> try building the code in all of those language modes nor telling 
us they<BR>> intend to build the code in those modes (by using -Wc++-compat, 
for instance),<BR>> I think it's reasonable to say that they are beyond our 
help.<BR>> <BR>> The -Wc++-compat warning we already have is nice, but we 
should probably also<BR>> warn (with an on-by-default warning!) if this 
occurs in an extern "C" block<BR>> in C++.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Consolas>An extension to this would be to additionally 
include this warning if the<BR>compiler comes across a use of the __cplusplus 
macro in C mode, perhaps?<BR></FONT></DIV></BODY></HTML>