Open jyn514 opened 4 years ago
This was broken in b7a16c258d0db41ee67e7a7b8daf9295ca44e7cf, cc @hdamron17
$ rg '#define __GLIBC_USE' /usr/include/
/usr/include/features.h
179:#define __GLIBC_USE(F) __GLIBC_USE_ ## F
Minimal reproduction:
#define __GLIBC_USE(F) __GLIBC_USE_ ## F
# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
# define __GLIBC_USE_ISOC2X 1
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
int main() {}
#endif
<stdin>:4:4 error: invalid macro: trailing tokens in `#if` expression
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<stdin>:6:2 error: invalid macro: #endif without #if
#endif
^^^^^
I think this is just that ##
isn't implemented and the error is slightly different than before: http://port70.net/~nsz/c/c11/n1570.html#6.10.3.3
It passed the tests..? I'm confused how if it depended on ##
Well, hello_world.c
is platform dependent. So glibc on my machine is probably different from glibc on travis. I just haven't tried to run the tests since you merged that fix.
Hmm. I thought I ran it on my Ubuntu machine but maybe not. Or it could be different there too.
I don't think ## will be too hard to implement. But maybe that's a problem for after you finish separating out the preprocessor.
I don't think ## will be too hard to implement. But maybe that's a problem for after you finish separating out the preprocessor.
Let's not wait for me to separate the preprocessor 😅 we'll be here a while. I don't expect ##
to make it any harder to separate than it already is.
This is going to be a lot harder than I originally thought because we're dealing with tokens not plain strings and the token type can change in concatenation. E.g. 5 ## e5
(int, id) -> 5e5
(float).
Expected behavior
cargo run tests/runner-tests/hello_world.c
works on linux platforms.Code