patch for unsigned bitfields

grahams grahams@rcp.co.uk
Wed Apr 19 04:50:00 GMT 2000


Robert

There is a typo in your patch to system.h (see relevant
part of patch below). It might also be prudent to add ()
around the expression.

Also there are some uses of ONLY_INT_FIELDS in cp/cp-tree.h
and java/parse.h which should also use the new ENUM_BITFIELD.

Graham

Robert Lipe wrote:

> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/system.h,v
> retrieving revision 1.61
> diff -u -p -r1.61 system.h
> --- system.h    2000/02/27 00:10:14     1.61
> +++ system.h    2000/04/18 17:15:25
> @@ -547,4 +547,16 @@ extern void abort PARAMS ((void));
>  /* Get libiberty declarations. */
>  #include "libiberty.h"
> 
> +/* Enumerated bitfields are safe to use u nless we've been explictly told
> + * otherwise or if they are signed. */
> +
> +#define USE_ENUM_BITFIELDS __GNUC__ || (!ONLY_INT_FIELDS && ENUM_BTIFIELDS_ARE_UNSIGNED)

								    ^^^ TYPO
> +
> +#if USE_ENUM_BITFIELDS
> +#define ENUM_BITFIELD(TYPE) enum TYPE
> +#else
> +#define ENUM_BITFIELD(TYPE) unsigned int
> +#endif
> +
> +
>  #endif /* __GCC_SYSTEM_H__ */
>


More information about the Gcc-patches mailing list