3 ms·
extern "C" { ... } unfortunately only turns off C++ name mangling for symbols, it doesn't switch the C++ compiler into "C language mode". Such a feature would b
by flohofwoe 3y ago
extern "C" { ... } unfortunately only turns off C++ name mangling for symbols, it doesn't switch the C++ compiler into "C language mode". Such a feature would be incredibly useful though for mixing C and C++ code in the same source file.
- pjmlp 3y agoNaturally, that was always its goal, extern "language" {} produces the same linkage model as language. Even though many only know it with C, Fortran, Pascal and Ada were also common when C++ was gaining adoption. It was never about being a polyglot compiler.