tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] spurious "cast expected" error when initialising a st


From: j . eh
Subject: Re: [Tinycc-devel] spurious "cast expected" error when initialising a struct
Date: Mon, 31 Mar 2014 07:36:50 -0600
User-agent: Mutt/1.4.1i

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}
};


John



reply via email to

[Prev in Thread] Current Thread [Next in Thread]