Date: Mon, 8 Sep 1997 11:07:52 +0200 (MET DST) From: Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE> To: joerg_wunsch@uriah.heep.sax.de Cc: hackers@FreeBSD.ORG Subject: Re: 'warning: function declaration isn't a prototype' Message-ID: <199709080907.LAA05238@rvc1.informatik.ba-stuttgart.de> In-Reply-To: <19970908002641.TV55800@uriah.heep.sax.de> from J Wunsch at "Sep 8, 97 00:26:41 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> As Jonathan Mini wrote:
>
> > ...and I was prototyping. Like this :
> >
> > static void msctimer();
> >
> > I changed it to :
> >
> > static void msctimer(void);
> >
> > ... and the problem went away. Funny, I have never received that watning
> > before, and I have been using C (with prototypes like that) for many years.
>
> That's not a `prototype' in the strict ANSI sense. Unless we were
> talking about C++, where the omission of function parameters is
> equivalent to declaring the list as just `void'. But then, C++ always
> requires prototypes, unlike ANSI C.
>
> What you've been using is what K&R II calls ``old-style function
> declarations''.
Strange thing is, I cannot provoke this warning, i. e this source
compiles with -ansi -pedantic -Wall option without any messages
output by cc(1). What am I missing?
Wolfgang
The Source(tm):
#include <stdio.h>
static void func(); /* This is not valid */
static void func2(void);
void
main (void)
{
printf("Hello, world\n");
func();
func2();
}
static void
func()
{
printf("Dies ist func()\n");
}
static void
func2()
{
printf("Dies ist func2()\n");
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709080907.LAA05238>
