Bug With Floating-Point NaN
The a > b ? a : b check will fail when b is NaN and a is not, since comparison with NaN is always false. The expected behavior is to return a. Use fmax, fmaxf or fmaxl for these types.
Prior to C23, there is theoretically another issue that could come up with the sign-and-magnitude representation of -0. In C23, all signed integral types are two’s-complement.