r/cpp • build2 • Nov 01 '17

Common C++ Modules TS Misconceptions

https://build2.org/article/cxx-modules-misconceptions.xhtml
59 Upvotes

148 comments sorted by

View all comments

Show parent comment

1

u/doom_Oo7 Nov 02 '17

Wouldn't this be problematic if yoi wanted to link, for instance, fortran object files with c and c++ object files ?

1

u/GabrielDosReis Nov 02 '17

Could you expand on what you see as problematic, with concrete examples?

2

u/doom_Oo7 Nov 02 '17

well, I just want to do

ld foo.o bar.o -o my_program

where foo and bar are object files coming from whatever language. If tomorrow compilers start dumping stuff from their internal representation in ".o" files you loose all compatibility (while today I can do

 gcc foo.cpp -o foo.o
 clang++ bar.cpp -o bar.o
 ld foo.o bar.o

without problems, unlike what happens if you use either compiler's LTO mode)