Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4946594

Sun C compiler option -xc99=%none is not used, allows C99 features not wanted

XMLWordPrintable

    • b28
    • generic
    • generic

      Sun C compiler option -xc99=%none is not used, allows C99 features not wanted

      I was wondering why the Sun C compiler allowed things like:

      int main(void)
      {
          int i;
          i++;
          float f = (float)i;
          i++;
          int x = i;
          x = 0;
          return x;
      }

      when this wasn't valid C and the Windows build would fail compiling it
      (warning error which isn't allowed in 'standard C' mode).

      Turns out that the latest Sun C compiler allows C99 features (of which this
      is one of them) by default unless you turn them off with -xc99=%none.

      Since I assume we want our J2SE C code to continue to be "Standard C"
      and not C99, we need to add this option. It makes no sense to allow this
      kind of code to compile on one platform, but not another.

      -kto

      ###@###.### 2003-10-30

            ohair Kelly Ohair (Inactive)
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: