From owner-freebsd-hackers Mon Sep 8 02:09:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA19672 for hackers-outgoing; Mon, 8 Sep 1997 02:09:21 -0700 (PDT) Received: from rvc1.informatik.ba-stuttgart.de (rvc1.informatik.ba-stuttgart.de [141.31.112.22]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA19666 for ; Mon, 8 Sep 1997 02:09:17 -0700 (PDT) Received: (from helbig@localhost) by rvc1.informatik.ba-stuttgart.de (8.8.7/8.8.5) id LAA05238; Mon, 8 Sep 1997 11:07:52 +0200 (MET DST) From: Wolfgang Helbig Message-Id: <199709080907.LAA05238@rvc1.informatik.ba-stuttgart.de> Subject: Re: 'warning: function declaration isn't a prototype' In-Reply-To: <19970908002641.TV55800@uriah.heep.sax.de> from J Wunsch at "Sep 8, 97 00:26:41 am" To: joerg_wunsch@uriah.heep.sax.de Date: Mon, 8 Sep 1997 11:07:52 +0200 (MET DST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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 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"); }