Varargs, portability

Andrew Koenig ark at alice.UucP
Sat May 24 06:38:01 AEST 1986


>>Is the following program portable to any machine which provides a
>>(reasonable) implementation of C.
>> ...
>>	joe( 1,2.5,3,4.5,5,6.5,7,8.5,9,10.5,11,12.5,13,14.5,15, 16.5, 17, 
>>18.5, 19,20.5,21,22.5,23,24.5,25,26.5,27,28.5,29,30.5,31,32.5,33,34.5,35,36.5,
>>37,38.5,39,40.5,41,42.5,43,44.5,45,46.5,47,48.5,49,50.5,51,52.5) ;
>
>No, because you have exceeded the VAX's 255-byte argument limit.

Putting it another way: some compilers may be broken.

It is the compiler's job to shield users from silly restrictions
in the hardware.  Of course, some compilers fall down on the job.



More information about the Comp.unix.wizards mailing list