[Bug c/81777] Compiler doesn't detect wrong function declaration

2017-08-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81777

--- Comment #3 from Andrew Pinski  ---
Also -Wmissing-declarations helps here to make sure you have a declaration
before an external definition. It will warn as you don't have a declaration for
testarg function in testarg.c.

[Bug c/81777] Compiler doesn't detect wrong function declaration

2017-08-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81777

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #2 from Andrew Pinski  ---
Yes this is because this is not required to issue a diagnostic at compile time.
Also there is no real way. -flto is able to diagnose this though due to having
all the information while linking.

[Bug c/81777] Compiler doesn't detect wrong function declaration

2017-08-09 Thread jsiebert at poczta dot wp.pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81777

--- Comment #1 from jsiebert at poczta dot wp.pl ---
file test.c:
#include "testarg.h"

int main(void)
{
testarg();
return 0;
}