On Wed, 22 Jan 2003, Mike Barton wrote:

> You should be moving vnums from sh_int to int, not int to long int.

I disagree.  Just because it is easier to convert the code, and happens
to work on one particular compiler/architecture doesn't make it a good
idea.  There's no reason to explicitly hinder code portability like this.

If you want the range of a long int, use a long int.  Or use an
architecture independent type with the required range.

> The reality is that short ints are converted to normal ints when they are
> passed to a function..

To be more precise, short ints are converted to normal ints when
they are passed to a function without a prototype, when they are
passed to a variable argument function (except for the declared
parameters), and when they are passed to a function expecting
an int parameter.

A short int is not converted to an int when passed to a function
with a prototype specifying a short int parameter.

> And long ints are the same size as normal ints on
> most machines.  So %d can handle any of them gracefully.

"Most machines" just isn't good enough in my opinion.


Dennis


Reply via email to