Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #67887
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Don't extensions still work? (Was: Trying to be generic with the linker (ld instead of g++)) |
| Date | 2019-08-22 12:57 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <8636ht2csl.fsf@mailhub.linuxsc.com> (permalink) |
| References | <fd41e1db-a2dc-445e-8ecb-f176d3361e03@googlegroups.com> <864l29ifqm.fsf@mailhub.linuxsc.com> <qjm0qg$5an$3@news.xmission.com> |
gazelle@shell.xmission.com (Kenny McCormack) writes: > In article <864l29ifqm.fsf@mailhub.linuxsc.com>, > Tim Rentsch <tr.17687@z991.linuxsc.com> wrote: > ... > >> Forgive me if this is a dumb question. Is there some reason >> you have to use gcc in the first step? How about doing this >> instead: >> >> g++ -x c -c *.c >> g++ -x c++ -c *.cpp >> g++ -o prog *.o >> >> Substituting clang for g++ should also work here. Disclaimer: I >> haven't verified anything beyond confirming that both g++ and >> clang accept the -x c and -x c++ options. > > I didn't even think you needed the -x option, as long as your > files have recognized extensions. [...] For things like C and C++, which have widely recognized ISO standards, I don't mind taking the established rules as being authoritative, and acting accordingly. For tools like gcc or g++ or clang, which depend on the whims of whichever developers happen to be contributing, and which easily may change from one version to another, my usual practice is to spell things out more explicitly. Here I think it helps convey the point if the -x c and -x c++ options are made explicit rather than being left as implied.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread
Trying to be generic with the linker (ld instead of g++) Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-08-20 04:09 -0700
Re: Trying to be generic with the linker (ld instead of g++) Bart <bc@freeuk.com> - 2019-08-20 12:25 +0100
Re: Trying to be generic with the linker (ld instead of g++) Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-08-20 04:34 -0700
Re: Trying to be generic with the linker (ld instead of g++) Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2019-08-21 01:07 +0100
Re: Trying to be generic with the linker (ld instead of g++) Keith Thompson <kst-u@mib.org> - 2019-08-20 15:50 -0700
Re: Trying to be generic with the linker (ld instead of g++) Bart <bc@freeuk.com> - 2019-08-21 00:27 +0100
Re: Trying to be generic with the linker (ld instead of g++) Ralf Fassel <ralfixx@gmx.de> - 2019-08-20 14:05 +0200
Re: Trying to be generic with the linker (ld instead of g++) David Brown <david.brown@hesbynett.no> - 2019-08-20 14:10 +0200
Re: Trying to be generic with the linker (ld instead of g++) Keith Thompson <kst-u@mib.org> - 2019-08-20 15:58 -0700
Re: Trying to be generic with the linker (ld instead of g++) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-08-22 04:47 -0700
Don't extensions still work? (Was: Trying to be generic with the linker (ld instead of g++)) gazelle@shell.xmission.com (Kenny McCormack) - 2019-08-22 12:12 +0000
Re: Don't extensions still work? (Was: Trying to be generic with the linker (ld instead of g++)) David Brown <david.brown@hesbynett.no> - 2019-08-22 15:08 +0200
Re: Don't extensions still work? (Was: Trying to be generic with the linker (ld instead of g++)) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-08-22 12:57 -0700
csiph-web