4 ms·
The preprocessed output of GCC and Clang usually contains the file names.
by carlmr 6y ago
The preprocessed output of GCC and Clang usually contains the file names.
- inetknght 6y agoBetter than that, compilers can be told to include line numbers too. This thread would love to learn about Compiler Explorer https://gcc.godbolt.org/ https://gcc.godbolt.org/ which works for C++ and many other languages.
- philsnow 6y agoLine numbers are a good start, but JS source maps go from output source byte ranges to input source byte ranges. I don't write or even read a lot of C++ these days but I recall from when I did that a major pain point was deciphering compiler warnings/errors when there are a lot of templates, macros, or both. Seems like the problem has been around forever.