https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81777
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- 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.