🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Peter Seebach Tue, 19 Nov 1996 00:00
Neat new bug!
#6159
Author: Peter Seebach
Date: Tue, 19 Nov 1996 00:00
11 lines
800 bytes
The declaration
	int foo(void a[2]) {
	}
is perfectly correct, and declares foo to take a *pointer to void* as
an argument.  gcc -ansi -pedantic -Wall should not reject it.  (I could
easily see a warning as appropriate, but the message
>t.c:3: declaration of `a' as array of voids
is clearly not correct; no parameter is ever an array.)

-s
Re: Neat new bug!
#6160
Author: David Kastrup
Date: Wed, 20 Nov 1996 00:00
26 lines
1714 bytes
seebs@intran.xerox.com (Peter Seebach) writes:

> The declaration
> =09int foo(void a[2]) {
> =09}
> is perfectly correct, and declares foo to take a *pointer to void* as
> an argument.  gcc -ansi -pedantic -Wall should not reject it.  (I could
> easily see a warning as appropriate, but the message
> >t.c:3: declaration of `a' as array of voids
> is clearly not correct; no parameter is ever an array.)

Personally, I think the error message correct: one declares the types
of ones' arguments, and that arrays get converted to pointers is a
technicality.  At least this is the way I feel it should be, which, of
course, signifies nothing.

So I presume somebody ought to whip out some standard and quote it so
as to make us all happy.


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f=FCr Neuroinformatik, Universit=E4tsstr. 150, 44780 Bochum, Germa=
ny
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads