This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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 up bswap_* types


On Sun, 19 Aug 2012, Marek Polacek wrote:

> it would be IMNSHO better to use uint64_t directly, as this is the type
> that the gcc builtin takes and returns.  For instance __builtin_bswap64
> is defined as:
> DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64,
> 		 ATTR_CONST_NOTHROW_LEAF_LIST)
> and BT_UINT64 is:
> DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node)

But uint64_type_node etc. do not necessarily correspond to the stdint.h 
typedefs (see <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37743>; making 
them correspond to the typedefs involves finishing adding stdint.h type 
information to GCC for various target OSes).

> So this patch changes various unsigned ints to uint*_t variants.  It

When posting a patch where corresponding ports changes would be 
appropriate but are not included, please call out in the submission where 
ports changes may be appropriate.

> silences two warnings in debug/pcprofiledump.c and does not cause
> any new warnings on both x86_64/i?86.  I've checked places where
> these bswap_* functions are used and callers are using appropriate
> uint*_t types.  So no changes needed there.

You are making headers include <stdint.h> that didn't previously.  Could 
you detail the analysis of what public headers, directly or indirectly, 
end up including <stdint.h> as a result, and why it is OK in namespace 
terms for those headers to expose all symbols from <stdint.h> if they 
didn't already do so?

-- 
Joseph S. Myers
joseph@codesourcery.com


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