Safe, fully standards-following integer abs in C
This kind of code relies on careful reading of the standard, so if it were me I would add cross-references to the sections of the standard that I was relying on, for example I might write:

/* This relies on the following facts from the C99 standard:
 * 
 * §6.2.5.9 The range of nonnegative values of a signed integer
 * type is a subrange of the corresponding unsigned integer type.
 * It follows from this and §7.18.2.5 that UINTMAX_MAX &gt;=
 * INTMAX_MAX.
 *
 * §6.2.6.2.2 Signed integers are represented as sign-and-
 * magnitude, two's complement, or one's complement. It follows
 * that INTMAX_MIN is either -INTMAX_MAX (in sign-and-magnitude or
 * one's complement) or -INTMAX_MAX-1 (in two's complement).
 */

I don't like writing code that can't be tested on any platform that I have access to. Although the code looks good in this case, if you pursued this approach on a bigger scale, then it would be very surprising if all the untested code were correct. I would prefer to write something like:

#if UINTMAX_MAX == INTMAX_MAX &amp;&amp; INTMAX_MIN &lt; -INTMAX_MAX
#error "Two's complement with UINTMAX_MAX == INTMAX_MAX is not supported."
#endif


so that untested platforms get a compiler error instead of compiling and executing untested code. In the unlikely event that you discover such a platform, you can add the code and test it at that point.