Le 2014-03-31 21:36, j...@mchsi.com a écrit :
On Mon, Mar 31, 2014 at 01:42:36PM +0100, Jay Foad wrote:
In this example I get a spurious error, but only when I elide some
braces *and* put parentheses around the literal:

$ cat a.c
struct {
  struct {
    int i;
  } a;
} x = {
  (3)
};
$ ./tcc a.c
a.c:6: error: cast expected

Some compilers accept it but issues warning (with -Wall).
The following should always be valid:

struct {
   struct {
     int i;
   } a;
} x = {
   {3}
};

At least according to C99 not all parenthesis are necessary if there is no ambiguity. It's a known bug but nobody found time / interest to work on this yet. Maybe for tcc 0.9.27 as I remember grischka warning that the current code is not adapted to detect this and some important changes would be needed.

Best regards,

Thomas

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to