From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18742 invoked by alias); 8 Jun 2002 19:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18728 invoked by uid 71); 8 Jun 2002 19:46:02 -0000 Date: Sat, 08 Jun 2002 12:46:00 -0000 Message-ID: <20020608194602.18727.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Terry Moreland Subject: Re: c/6968: functions that shouldn't accept arguments accept infinite arguments (eg; test() ) Reply-To: Terry Moreland X-SW-Source: 2002-06/txt/msg00189.txt.bz2 List-Id: The following reply was made to PR c/6968; it has been noted by GNATS. From: Terry Moreland To: "Joseph S. Myers" Cc: zack@gcc.gnu.org, , Subject: Re: c/6968: functions that shouldn't accept arguments accept infinite arguments (eg; test() ) Date: Sat, 8 Jun 2002 15:29:18 -0400 (EDT) ok, I'll accept that, but still passing arguments to a function defined in this way should still produce a warning since the arguments are inaccessible from within the function and it just looks wrong Terry On Sat, 8 Jun 2002, Joseph S. Myers wrote: > On Sat, 8 Jun 2002, Terry Moreland wrote: > > > mean that in c99 void test() is a function that takes no arguments since > > enmpty identifier list is part of the function definition and as such the > > void test() example should produce an error in c99, but doesn't in gcc 3.1 using > > -std=c99 > > > > please let me know if I am wrong, I have slept in a while and the iso c99 spec > > can be very wordy at times > > It specifies, for the purposes of the definition, that it has no > parameters. It does not, for the purposes of subsequent calls to the > function, give it a type that includes a prototype, so the subsequent > calls are not checked. > > -- -------------------------------------------------------- Terry Moreland | Computer and Information Science tmorelan@uoguelph.ca | University of Guelph If you were plowing a field, which would you rather use? Two strong oxen or 1024 chickens? - Seymour Cray (1925-1996), father of supercomputing --------------------------------------------------------