This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81587] GCC doesn't warn about calling functions that don't exist
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Jul 2017 01:39:21 +0000
- Subject: [Bug c++/81587] GCC doesn't warn about calling functions that don't exist
- Auto-submitted: auto-generated
- References: <bug-81587-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81587
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC does warn for unused types and variables in local scope so it makes sense
that it also warn for unused functions declared in local scope. You might want
to open a new bug report and request a warning for locally declared but unused
functions.
$ cat t.C && gcc -S -Wall t.C
void f (void)
{
typedef int I;
int i;
void g ();
}
t.C: In function ‘void f()’:
t.C:4:7: warning: unused variable ‘i’ [-Wunused-variable]
int i;
^
t.C:3:15: warning: typedef ‘I’ locally defined but not used
[-Wunused-local-typedefs]
typedef int I;
^