On 2021-04-16 07:11:27 +0200, Christian Jullien wrote: > Even more strange, __LINE__ type changes as it overflows on clang, and gcc: > > int > main() { > #line 2147483647 > printf("__LINE__: %s\n", TYPEOF(__LINE__)); > #line 3000000000 > printf("__LINE__: %s\n", TYPEOF(__LINE__)); > } > > jullien@sims4:~ $ gcc -std=c11 foo.c -o foo && ./foo > __LINE__: int > __LINE__: long long
I think that this is expected. The standard just says that it is an integer constant, not that it has a fixed type (which could break many applications, as the largest type would have to be chosen even for small line numbers). In practice, it just probably gives a sequence of decimal digits (without a suffix), and the type is deduced as usual for integer constants. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel