https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88501
--- Comment #7 from Jonny Grant <jg at jguk dot org> --- Here is anotehr example. I expected <string.h> to be suggested, as that contains exact match strerror() Current G++ trunk output <source>: In function 'int main()': <source>:14:33: error: 'errno' was not declared in this scope 14 | printf("%s\n", strerror(errno)); | ^~~~~ <source>:4:1: note: 'errno' is defined in header '<cerrno>'; did you forget to '#include <cerrno>'? 3 | #include <stdio.h> +++ |+#include <cerrno> 4 | int main() <source>:14:24: error: 'strerror' was not declared in this scope; did you mean 'perror'? 14 | printf("%s\n", strerror(errno)); | ^~~~~~~~ | perror Compiler returned: 1 example // gcc -o glibc_realpath glibc_realpath.c #include <stdlib.h> #include <stdio.h> int main() { const char * path = "/usr/bin/../include/myheader.h"; //errno = 0; char * result = realpath(path, NULL); printf("result: [%s]\n", result); if(NULL == result) { printf("%s\n", strerror(errno)); } return 0; }