S
slashdotcommacolon
Hello, I've been asked to port some old code to a new platform. We have
a vendor-supplied compiler that is supposed to be ansi compliant, but
it refuses to compile the following code:
$ cat test.c
int main(int argc, char **argv)
{
static int a, b, c, d, e, f, g, h, i, j, k;
return k = a ? b++, c : d ? e++, f : g ? h++, i : j;
}
The error is 'ternary operation `?:` unterminated', however the GNU
compiler accepts it even in 'pedantic' mode. It's not a problem, as I
just rewrote the code, but I'm curious if this code (as i suspect)
looks acceptable to you language lawyers, if so I'll file a bug report
with the vendor.
Thanks guys.
a vendor-supplied compiler that is supposed to be ansi compliant, but
it refuses to compile the following code:
$ cat test.c
int main(int argc, char **argv)
{
static int a, b, c, d, e, f, g, h, i, j, k;
return k = a ? b++, c : d ? e++, f : g ? h++, i : j;
}
The error is 'ternary operation `?:` unterminated', however the GNU
compiler accepts it even in 'pedantic' mode. It's not a problem, as I
just rewrote the code, but I'm curious if this code (as i suspect)
looks acceptable to you language lawyers, if so I'll file a bug report
with the vendor.
Thanks guys.