Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing too many parameters to a function?




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: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Passing too many parameters to a function? (From: Camillo Lugaresi <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.