home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!sasghm
- From: sasghm@theseus.unx.sas.com (Gary Merrill)
- Subject: Re: Is "...", instead of ",..." legal ?
- Originator: sasghm@theseus.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BsxnCI.HDr@unx.sas.com>
- Date: Thu, 13 Aug 1992 17:31:30 GMT
- References: <1992Aug13.002717.18476@megadata.mega.oz.au>
- Nntp-Posting-Host: theseus.unx.sas.com
- Organization: SAS Institute Inc.
- Keywords: variable arguments
- Lines: 27
-
-
- In article <1992Aug13.002717.18476@megadata.mega.oz.au>, scott@megadata.mega.oz.au (Scott Humphreys) writes:
- |> 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.
-
- This is non-ANSI, but some compilers permit it. (Generally what
- it really means is "Here's a prototype, so don't annoy me with
- a message about a missing prototype for this function. But I
- won't give you a clue about what the parameters are, so don't even
- try to check them.")
- --
- Gary H. Merrill [Principal Systems Developer, C Compiler Development]
- SAS Institute Inc. / SAS Campus Dr. / Cary, NC 27513 / (919) 677-8000
- sasghm@theseus.unx.sas.com ... !mcnc!sas!sasghm
-