This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: GCC optimizes integer overflow: bug or feature?



Or you can do, since elsewhere in the code you compute time_t_max:

for (j = 1; j <= time_t_max / 2 + 1; j *= 2)

No, this does not work. It would work to have:


  for (j = 1;;)
    {
      if (j > time_t_max / 2)
        break;
      j *= 2;
    }

Oops.

Paolo


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