Question for C language nerds: is this actually undefined behavior? It's in the Juliet test suite, but I can't figure out if truncating a signed int value to a char is undefined...
Conversation
Replying to
I like to use tis-interpreter as a sanity check for small samples like this:
1
2
Replying to
I've always meant to try out tis-interpreter. Unfortunately the current version doesn't build for me (String/bytes issue) and the link to the binary is 404...
1
2
For this kind of example, tsnippet.trust-in-soft.com is always the most up-to-date (but is only sometimes broken because of being too bleeding-edge).
As for this example, no UB on a platform where int is wider than char(>99.9% of platforms) or where char is unsigned, LOL (0.1%?)
2
5
char is unsigned on PowerPC and ARM.




