Closed andrewchambers closed 9 years ago
We do have one. Look at read_line() in cpp.c. I haven't actually tested that against GCC output though.
Ah ok, It was failing badly on my PC, I'll reduce the test case and maybe fix.
Ah, my gcc isn't emitting #line,
here is an example of what gcc is spitting out:
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "foo.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 29 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/_ansi.h" 1 3 4
# 15 "/usr/include/_ansi.h" 3 4
# 1 "/usr/include/newlib.h" 1 3 4
# 16 "/usr/include/_ansi.h" 2 3 4
# 1 "/usr/include/sys/config.h" 1 3 4
here is a reference to what they mean: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html
Okay this is a GNU extension to the language. It looks interesting, I'll implement that later. At this moment I got to focus on the new backend, so please slow down a bit.
No problem. I'll track these on my own fork then test them again after that branch is integrated.
I don't think 8cc handles line directives currently, so you can't pass code preprocessed by gcc.