Re: Passing too many parameters to a function?
Re: Passing too many parameters to a function?
- Subject: Re: Passing too many parameters to a function?
- From: Graham J Lee <email@hidden>
- Date: Mon, 18 Sep 2006 22:59:12 +0100
On 18 Sep 2006, at 21:06, Camillo Lugaresi wrote:
On 20/ago/06, at 12:17, Uli Kusterer wrote:
Hi,
you know how main() can be declared with varying parameter
counts, like
int main()
or
int main( int argc, const char* argv* )
and even more. Does this work for any function?
I just read this thread, and although it's old, it seems that it
did not reach a conclusion, so forgive me for resurrecting it. :)
If you look at the PPC and IA32 ABIs, it seems that what you want
to do is safe.
Although that doesn't conform with any published version of the C
standard[*], so if Apple ever decided that their C really *is* C then
you'd be up the proverbial tributary...
[*]It's only main() which is /allowed/ more than one prototype, and
then there are only two. I think the rare main(argc,argv,envp) is
only ever an implementation-specific monstrosity.
--
Graham J Lee
http://www.thaesofereode.info/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden