This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: autoconf for type sizes


On Mon, Mar 12, 2001 at 12:03:19PM -0800, Zack Weinberg wrote:
> +   AC_TRY_COMPILE(,
> +   [char test[(char)((char)1 << $i)
> +               ? (char)((char)1 << $i) == 1 ? 1 : -1
> +               : 1];],

The "(char)1" cast isn't needed.  The example I gave you would work
for long too, which does need it.  Also, don't you need special handling
for embedding [] here?  I suppose you could use the switch trick:

  switch (0) { case 0: case (char)(1 << $i) && (char)(1 << $i) != 1: ; }

Otherwise ok.


r~


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