inline functions should not trigger `no previous declaration'
Martin Buchholz
martin@xemacs.org
Mon Nov 2 22:03:00 GMT 1998
-Wmissing-declarations is nice, except for inline functions, since
those are generally found in header files anyways. Folks have been
observed putting this sort of ugliness in their header files to be
able to continue using -Wmissing-declarations:
inline int foo (unsigned int x);
inline int foo (unsigned int x)
{
return x + 1;
}
Shell transcript follows:
(martin@lasker) ~/src $ egcs -Wmissing-declarations -c inline-warning.c
inline-warning.c:2: warning: no previous declaration for `foo'
(martin@lasker) ~/src $ cat inline-warning.c
inline int foo (unsigned int x)
{
return x + 1;
}
int main (int argc, char *argv[])
{
return foo(3);
}
(martin@lasker) ~/src $ egcs --version
egcs-2.92.18
(martin@lasker) ~/src $ uname -a
Linux lasker.worley.com 2.1.105 #9 SMP Tue Jun 9 16:21:01 PDT 1998 i686 unknown
More information about the Gcc-bugs
mailing list