The second argument of the functions modf, modff, modfl must not be a NULL pointer, according to POSIX, and the glibc implementation also does not allow a NULL pointer. It would be useful to allow GCC to give a warning when someone passes a NULL literal to these functions. How to reproduce: ==================== foo.c ======================== #include <math.h> #include <stddef.h> int main () { return ! modf (2.4, NULL); } =================================================== $ gcc -Wall foo.c Expected result: foo.c: In function 'main': foo.c:6:3: warning: null argument where non-null required (argument 2) Actual result: No diagnostic. The fix should be easy: Add a properly conditionalized __attribute__ ((__nonnull__ (2))) to glibc/math/bits/mathcalls.h line 116.
Thanks. I send a patch to libc-alpha for this.
Changed in git.