<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
Easier said than done, given the layers of build system (automake). :(</p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
 - Jay</p>
<div><br>
</div>
<br>
<p></p>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Justin Bogner
<br>
<b>Sent:</b> Thursday, August 23, 2018 9:17 PM<br>
<b>To:</b> Jay K via llvm-dev<br>
<b>Cc:</b> Jay K<br>
<b>Subject:</b> Re: [llvm-dev] clang -xc++ foo.o</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Jay K via llvm-dev <llvm-dev@lists.llvm.org> writes:<br>
> clang -xc++ -c 1.c 2.c<br>
><br>
> clang -xc++ main.c 1.o 2.o<br>
> 1.o:1:1: error: source file is not valid UTF-8<br>
><br>
> Would be nice, albeit I realize kinda proby/non-deterministic/big, if<br>
> .o files were recognized and -xc++ did not apply to them.<br>
<br>
The -x flags only apply to files later on the command line than they<br>
are, so this works:<br>
<br>
clang -xc++ -c 1.c 2.c<br>
clang 1.o 2.o -xc++ main.c<br>
<br>
You may also be able to switch back to autodetection with -xnone, though<br>
I haven't tried this:<br>
<br>
clang -xc++ -c 1.c 2.c<br>
clang -xc++ main.c -xnone 1.o 2.o<br>
<br>
> I'm converting C to C++ and don't want to rename files, at least at<br>
> this point, maybe forever.<br>
><br>
> For now I've compromised and main remains C. It is much smaller than<br>
> the various libraries, so -xc++ is almost a complete solution.<br>
><br>
>  Thank you,<br>
>  - Jay<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> llvm-dev@lists.llvm.org<br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" id="LPlnk927497" class="OWAAutoLink" previewremoved="true">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>