K&R-style variadic functions

Regan Heath regan at netmail.co.nz
Tue Jul 17 07:36:03 PDT 2012


On Tue, 17 Jul 2012 15:01:02 +0100, Jacob Carlborg <doob at me.com> wrote:

> On 2012-07-17 15:05, Regan Heath wrote:
>
>> In my specific case I could add "int a" as the first parameter, and all
>> was well.  Each case will be different, and it's conceivable there is a
>> C old-style variadic which takes /any/ type of first parameter, which
>> could be a problem, however the key issue is the size of the argument.
>> If all types which could be passed are 32 bits big, then "int a" is
>> sufficient to get it working in all cases.
>
> It could just as well be no parameters.

I believe old-style no parameter function declarations MUST have "void"  
i.e.

	int foo(void);

They cannot read:

	int foo();

The latter MUST have parameters, we just can't tell what they are.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list