lua-users home
lua-l archive

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


> [...]  However, some trivial operation after
> the shift avoids the warning:
> 
>   #define twoto(x)	(int)(1u<<(x))   /* note: unsigned->signed cast operation */
>   #define twoto(x)	(int)(unsigned int)(1<<(x)) /* similar */
>   #define twoto(x)	(0 | 1<<(x))
> 
> All of these eliminate the Lua 5.1.4 warnings.  They do seem like hacks though.

Because they are. ;)

-- Roberto