Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Roland Dreier (rdreier_at_[hidden])
Date: 2007-04-18 16:15:55

> How about (u)int32_t? When I was an Ada programmer, subtypes with the
> approriate range were always encouraged (i.e.: define the semantical
> range and let the compiler/runtime library warn you on range
> violations (the well-known "CONSTRAINT_ERROR"))

It's OK to use a type with a fixed size when there is some real reason
that you know exactly how many bits you need, but in my opinion it's
much better to use plain int whenever possible. Otherwise you end up
in a mess when different functions have parameters of different widths
for no good reason, and you're also taking away the compiler's choice
to use the most efficient size of integer.

 - R.