🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Scott Humphreys Thu, 13 Aug 1992 20:46
Is "...", instead of ",..." legal ?
#936
Author: Scott Humphreys
Date: Thu, 13 Aug 1992 20:46
20 lines
1228 bytes
In various books describing the expansion to ANSI-C,
one of the differences is described as the inclusion
of the ",..." operator for function prototypes
[ meaning that a variable number of arguments follow-
  e.g. int printf (const char *, ...);  ]

My question is: is this legal : int foo (...);

That is - can I legally declare a function 
with none or many arguments, or does it HAVE to have
at least one argument.

This came up because gcc version 2.2.2 let me do it,
but gave a warning when used with the -pedantic option.
Another tool I used (gnu GCT version 1.3) bombed on this construct.

Thanks for your time - I trust this isn't a FAQ...
[individually cross posted to comp.lang.c as well]

			Regards, Scott
Is "...", instead of ",..." legal ?
#945
Author: Richard Stallman
Date: Fri, 14 Aug 1992 14:43
7 lines
786 bytes
There is no US law prohibiting a declaration of the form
    int foo (...);
so it must be legal here.  If you want to know about Australian law,
you'll have to ask an Australian lawyer.

However, perhaps what you really want to know is whether it is valid C.
It is not valid according to ANSI C.  However, GCC will let you write it.
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