http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46936
--- Comment #3 from Ondrej Bilka <neleai at seznam dot cz> --- > As per http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html, the > annotation on the example function there "causes the compiler to check that, > in > calls to my_memcpy, arguments dest and src are non-null." Is this a > documentation bug, or does the functionality that you're asking for already > exist? Gcc does not check that. Also this is not documentation request but request to add checks when _FORTIFY_SOURCE is defined. This would also mostly solve following bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308