This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix type inconsistencies in stdint.h


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Christopher Faylor on 4/4/2009 12:24 AM:
>> Because our stdint.h types are divergent from Linux, and changing them
>> instead could cause yet another ABI break.
> 
> Why would changing uint32_t from 'unsigned long' to 'unsigned int' break
> anything?  It looks to me like that is a disaster waiting to happen if
> we ever provide a 64-bit port.

If we ever provide a 64-bit port, then we are free to use #ifdef magic to
select a different underlying type on 64-bit compiles than on 32-bit
compiles.  In one sense, using a different type between the two builds
will flush out coding bugs where the wrong type specifiers are used (for
example, printf("%ld", (int32_t)val) should have been written
printf("%"PRI32d, (int32_t)val).

On the other hand, the fact that cygwin differs from Linux is already
flushing out these types of coding bugs.  Making the ABI change now (which
probably won't affect C apps, but will definitely affect any C++ code that
used uint32_t and friends in mangled names) will mean that cygwin no
longer trips true bugs in apps originally written on Linux by people not
aware of the issue.  It means easier porting jobs to cygwin, but also that
lurking bugs are that much harder to find when porting to yet another system.

I'm not sure we need the ABI change.  But I'm with Dave that IF we decide
the ABI change is the right thing to do, then NOW is the only time worth
doing it.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknbTSwACgkQ84KuGfSFAYDP8ACgsENCESTjm6ANnyiBKPcTLr3E
zWcAniczYlqVaN5WiEH82riv3aKkZg9b
=YaqT
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]