It looks like ICC is missing support for the retuns_nonnull attribute (tested up to 19.0.1), which has been present in GCC since 4.9. Here is a quick test case:
#include <stdio.h> static const char* foo = "bar\n"; #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))) __attribute__((__returns_nonnull__)) #endif static const char* get_string(void) { return foo; } int main(void) { const char* s = get_string(); if (s != NULL) fputs(s, stdout); else fputs("This shouldn't happen\n", stdout); return 0; }