This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR c/11658


On Mon, 2 Feb 2004, Paolo Bonzini wrote:

> struct s { char c[1]; };
> struct s a;
> 
> int bug_cond2(void) { return (a.c ? : 0); }  /* { dg-error "array that cannot be converted" } */

I don't think this is a correct error; a.c clearly is an lvalue array;  
the only error should be that this function as written is returning a
pointer to char but has the wrong return type for that.  Probably the
parser handling of this extension should be calling default_conversion
before save_expr.

Also, please avoid use the empty structs and unions extension in these
testcases; it isn't necessary for them; and make those testing arrays 
explicitly specify -std=gnu89.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]