-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
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
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
- relates to
-
JDK-8224087 Compile C code for at least C99 Standard compliance
- Resolved
-
JDK-8175302 Enforce C standard complicance requirement on GCC and Clang
- Closed