GMP and 64-bit systems

Vincent Lefevre vincent at vinc17.org
Mon Jun 2 10:26:12 CEST 2008


On 2008-06-02 01:41:29 -0400, librik at panix.com wrote:
> I would say that if a public declaration in gmp.h such as:
>    unsigned long int mpn_popcount(const mp_limb_t *s1p, mp_size_t n);
> were changed to:
>    typedef  unsigned long int  mp_bit_count_t;
>    mp_bit_count_t mpn_popcount(const mp_limb_t *s1p, mp_size_t n);
> then the types have NOT changed.  They are identical at the binary
> level, the compiler-semantics level, and the C type compatibility
> level.  Only the literal text name has changed.  "typedef" doesn't
> create a new type, it creates a new identifier as a synonym for
> the given type.

Yes, this is perfectly safe. The ISO C99 standard says: "A typedef
declaration does not introduce a new type, only a synonym for the
type so specified."

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


More information about the gmp-discuss mailing list