Re: [PATCH rdma-core] mlx4: Fix 1<<31 expressions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2018-02-08 at 16:38 -0700, Jason Gunthorpe wrote:
>  enum {
> -	MLX4_WQE_BIND_TYPE_2		= (1<<31),
> +	MLX4_WQE_BIND_TYPE_2		= (1UL<<31),
>  	MLX4_WQE_BIND_ZERO_BASED	= (1<<30),
>  };

Hello Jason,

A quote from the C11 standard:

"The expression that defines the value of an enumeration constant shall be an
integer constant expression that has a value representable as an int. [ ... ]
Each enumerated type shall be compatible with char, a signed integer type, or
an unsigned integer type. The choice of type is implementation-defined but
shall be capable of representing the values of all the members of the
enumeration."

Does that mean that this change relies on extensions to the C standard?

Thanks,

Bart.��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux