https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78068
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> --- (In reply to Markus Trippelsdorf from comment #2) > (In reply to Andrew Pinski from comment #1) > > time declaration really is not present in the preprocessed source file. I > > can't seem to figure out why it is not though. > > > > I doubt this is a GCC bug rather than a gdb one (sim is considered part of > > gdb) or a glibc one. > > David asked me to open this bug. Thanks for filing it. > It is more an aesthetic issue. Clearly the suggestion "nice" is bogus. Indeed. > I think suggestions should be turned off for -Wimplicit-function-declaration > in general. Other compiler turn them off, too. > > markus@x4 tmp % clang -c emul_unix.i > emul_unix.c:818:16: warning: implicit declaration of function 'time' is > invalid in C99 [-Wimplicit-function-declaration] > time_t now = time ((time_t *)0); > ^ > 1 warning generated. > > markus@x4 tmp % icc -c emul_unix.i > emul_unix.c(818): warning #266: function "time" declared implicitly > time_t now = time ((time_t *)0); > ^ I'm hoping there's a way of keeping the suggestions. I think there are two cases here: (a) the user typoed the function name, as opposed to (b) the function name at the call site was correct, but for some reason the decl couldn't be found (e.g. due to a missing #include, or bogus #if somewhere, etc) The suggestions code is currently written from the perspective of case (a), but I suspect that it was case (b) that happened here (and which is why "time" doesn't show up in the preprocessed reproducer).