@fay59 @whitequark why is strlen("\x001234") , uh , 1
13 comments
@fay59 @whitequark its because the hex literal is truncated to a byte, and then that's your character ????? @iximeow This is prohibited by the C++ standard, and GCC rejects if you pass "-pedantic -pedantic-errors". @iximeow In C this is... implementation-defined I think? https://cigix.me/c17#6.4.5.p6 (last sentence) and https://cigix.me/c17#6.4.4.4.p6 @iximeow @whitequark ah. yes. that seems "logical" to me, because this is C. pardon my (slightly) gray hair. @iximeow @whitequark I know I ran into this before because now I remember I tried to write “\x01” “c” to resolve the ambiguity and it STILL merges them @typeswitch @iximeow @whitequark lol I guess I got confused because -Xclang -ast-dump shows char[3] “\001c” and the octal syntax eats exactly 3 digits @typeswitch @iximeow @whitequark (and c isn’t an octal digit, but \010000 still parses to “\010””000” and I should probably get away from computers for the rest of the day) |
@fay59 @whitequark oh my fucking god