https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71858
Bug ID: 71858 Summary: Surprising suggestions for misspellings Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Target Milestone: --- (from email) -------------------------------------------------------------------- $ cat /tmp/a.c int main(int argc, char **argv) { return bar(); } $ ./xgcc -B. /tmp/a.c /tmp/a.c: In function ‘main’: /tmp/a.c:3:10: warning: implicit declaration of function ‘bar’; did you mean ‘carg’? [-Wimplicit-function-declaration] return bar(); ^~~ carg Which is a bit misleading as I do not include any header file. Looks it finds a builtin: (gdb) p debug_tree(m_best_candidate) <identifier_node 0x7ffff68faaa0 carg symbol <function_decl 0x7ffff68ff100 carg type <function_type 0x7ffff68adc78 type <real_type 0x7ffff68a55e8 double> QI size <integer_cst 0x7ffff6887d98 constant 8> unit size <integer_cst 0x7ffff6887db0 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7ffff68adc78 arg-types <tree_list 0x7ffff689b960 value <complex_type 0x7ffff68a5f18 complex double> chain <tree_list 0x7ffff689b7a8 value <void_type 0x7ffff68a5150 void>>>> readonly nothrow public external built-in decl_6 QI file <built-in> line 0 col 0 align 8 built-in BUILT_IN_NORMAL:BUILT_IN_CARG attributes <tree_list 0x7ffff68fd488>>> Well, I would expect it should consider __builtin_carg, but not carg. -------------------------------------------------------------------- I'm inclined to agree; I'll see if I can filter this better.