Is there a document describing how Clang handles excess floating-point precision?

This does not answer the originally posed question, but if you are a programmer working with similar issues, this answer might help you. I really don’t see where the perceived difficulty is. Providing strict IEEE-754 binary64 semantics while being limited to 80387 floating-point math, and retaining 80-bit long double computation, seems to follow well-specified C99 … Read more

Printf long long int in C with GCC?

If you are on windows and using mingw, gcc uses the win32 runtime, where printf needs %I64d for a 64 bit integer. (and %I64u for an unsinged 64 bit integer) For most other platforms you’d use %lld for printing a long long. (and %llu if it’s unsigned). This is standarized in C99. gcc doesn’t come … Read more

How to properly add hex escapes into a string-literal?

Use 3 octal digits: char problem[] = “abc\022e”; or split your string: char problem[] = “abc\x12” “e”; Why these work: Unlike hex escapes, standard defines 3 digits as maximum amount for octal escape. 6.4.4.4 Character constants … octal-escape-sequence: \ octal-digit \ octal-digit octal-digit \ octal-digit octal-digit octal-digit … hexadecimal-escape-sequence: \x hexadecimal-digit hexadecimal-escape-sequence hexadecimal-digit String literal … Read more

How to use compound literals to `fprintf()` multiple formatted numbers with arbitrary bases?

C99 C11 introduced compound literals which allow not only a complicated initialized structure, but also an “in-line” variable. Code can call a conversion function and pass in a new buffer (char [UTOA_BASE_N]){0} per each function call allowing the function to return that same buffer, now written as needed that is still within its lifetime. The … Read more