<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
TD {
MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
LI {
MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
BODY {
LINE-HEIGHT: 1.4; MARGIN: 10px; FONT-FAMILY: Arial, arial; FONT-SIZE: 9pt
}
</STYLE>
<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY>
<P> </P>
<P>As I understand 2 potential issues could be here</P>
<P>1) 'a' maynot be visible to the second '{ }' block containing std::cout</P>
<P>2) Asking for extern "C" linkage for a stack variable, implying there is some C code which needs to see this stack variable</P>
<P> </P>
<P>------- <B>Original Message</B> -------</P>
<P><B>Sender</B> : Arji Cot<arjicot@gmail.com></P>
<P><B>Date</B> : Jul 29, 2013 19:26 (GMT+05:30)</P>
<P><B>Title</B> : [cfe-dev] Why this extern "C" fails ?</P>
<P> </P><SPAN style="FONT-FAMILY: courier new,monospace">--------------<BR><BR>#include <iostream><BR><BR>int main() {<BR> {<BR> extern "C" { int a = 42; }<BR> { std::cout << a << "\n"; } <BR> }<BR> return (0);<BR>}</SPAN><BR><BR><SPAN style="FONT-FAMILY: courier new,monospace">--------------<BR><BR>this code fails to compile and the compiler message alone<BR><BR>main.cpp:5:12: error: expected unqualified-id<BR> extern "C" { int a = 42; }<BR> ^<BR>1 error generated.<BR><BR>It's not enough to me to explain why this is not working.<BR><BR>There is something that I'm missing ?<BR></SPAN>
<P> </P>
<P> </P><!--SP:senthil.t-->
<P>Regards</P>
<P>Senthil Kumar</P>
<P> </P><!--senthil.t:EP-->
<P> </P>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:QKNMBDIFBEI0@namo.co.kr" width=520></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=ebd2cebf32ec05a9b6b69d2b200a3e70b831b69ef4bfd7449cdd14f0554fc2de1d78c8484d0968ef1d70666c366810d91b20909a04efd4d2748cfe1d4e847419cf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>