http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61029

--- Comment #2 from Dmitry Chichkov <dchichkov at gmail dot com> ---
Ah. Yes. You are correct. It doesn't look like it is being truncated to 0, as
the following code:

  #include <limits.h>
  #include <stdio.h>

  int main() {
    short int a = SHRT_MIN;
    printf("%d\n", a);
    a = -a;
    printf("%d\n", a);
    return a;
  }

Results in:
  -32768
  -32768



But still, it doesn't seem right that code like "a = -a;" has to be writted as
a "a = static_cast<short int>(-a);" to avoid conversion warnings. That kills
readability while not adding any value.

Reply via email to