clang -xc++ -c 1.c 2.c clang -xc++ main.c 1.o 2.o 1.o:1:1: error: source file is not valid UTF-8 Would be nice, albeit I realize kinda proby/non-deterministic/big, if .o files were recognized and -xc++ did not apply to them. I'm converting C to C++ and don't want to rename files, at least at this point, maybe forever. For now I've compromised and main remains C. It is much smaller than the various libraries, so -xc++ is almost a complete solution. Thank you, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180816/e913bf2c/attachment-0001.html>
Jay K via llvm-dev <llvm-dev at lists.llvm.org> writes:> clang -xc++ -c 1.c 2.c > > clang -xc++ main.c 1.o 2.o > 1.o:1:1: error: source file is not valid UTF-8 > > Would be nice, albeit I realize kinda proby/non-deterministic/big, if > .o files were recognized and -xc++ did not apply to them.The -x flags only apply to files later on the command line than they are, so this works: clang -xc++ -c 1.c 2.c clang 1.o 2.o -xc++ main.c You may also be able to switch back to autodetection with -xnone, though I haven't tried this: clang -xc++ -c 1.c 2.c clang -xc++ main.c -xnone 1.o 2.o> I'm converting C to C++ and don't want to rename files, at least at > this point, maybe forever. > > For now I've compromised and main remains C. It is much smaller than > the various libraries, so -xc++ is almost a complete solution. > > Thank you, > - Jay > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Easier said than done, given the layers of build system (automake). :( - Jay ________________________________ From: Justin Bogner Sent: Thursday, August 23, 2018 9:17 PM To: Jay K via llvm-dev Cc: Jay K Subject: Re: [llvm-dev] clang -xc++ foo.o Jay K via llvm-dev <llvm-dev at lists.llvm.org> writes:> clang -xc++ -c 1.c 2.c > > clang -xc++ main.c 1.o 2.o > 1.o:1:1: error: source file is not valid UTF-8 > > Would be nice, albeit I realize kinda proby/non-deterministic/big, if > .o files were recognized and -xc++ did not apply to them.The -x flags only apply to files later on the command line than they are, so this works: clang -xc++ -c 1.c 2.c clang 1.o 2.o -xc++ main.c You may also be able to switch back to autodetection with -xnone, though I haven't tried this: clang -xc++ -c 1.c 2.c clang -xc++ main.c -xnone 1.o 2.o> I'm converting C to C++ and don't want to rename files, at least at > this point, maybe forever. > > For now I've compromised and main remains C. It is much smaller than > the various libraries, so -xc++ is almost a complete solution. > > Thank you, > - Jay > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180824/d603f6d0/attachment.html>
On Thu, Aug 23, 2018 at 2:02 PM Jay K via llvm-dev <llvm-dev at lists.llvm.org> wrote:> clang -xc++ -c 1.c 2.c > clang -xc++ main.c 1.o 2.o > 1.o:1:1: error: source file is not valid UTF-8 > > Would be nice, albeit I realize kinda proby/non-deterministic/big, if .o > files were recognized and -xc++ did not apply to them. >It would be nice, and can possibly be generalized to say: -xc++:.c (apply -xc++ to .c files going forward) -xnone:.o (prevent the effects of a previous -x from applying to .o files going forward)> I'm converting C to C++ and don't want to rename files, at least at this > point, maybe forever. > > For now I've compromised and main remains C. It is much smaller than the > various libraries, so -xc++ is almost a complete solution. > > Thank you, > - Jay > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180824/7ac5f0fd/attachment.html>