[cfe-commits] r55607 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/array-init.c

Neil Booth neil at daikokuya.co.uk
Mon Sep 1 15:39:23 PDT 2008


Eli Friedman wrote:-

> On Mon, Sep 1, 2008 at 2:22 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> >> +
> >> +// ptrs are constant
> >> +struct soft_segment_descriptor {
> >> +       int ssd_base;
> >> +};
> >> +static int dblfault_tss;
> >> +
> >> +union uniao { int ola; } xpto[1];
> >> +
> >> +struct soft_segment_descriptor gdt_segs[] = {
> >> +       {(int) &dblfault_tss},
> >> +       { (int)xpto},
> >> +};
> >
> > Thank you for the testcase. However, the fix isn't correct.  I'll file
> > a bug momentarily for this issue, and I'll generally try to be
> > responsive for issues like this.
> 
> Actually, this testcase already passes with trunk clang... what
> exactly is the patch trying to fix?

Should this not be diagnosed in strict mode, if only as an implemented
extension? Are you supporting this as an extension, or do you
believe it's valid?  I seems to violate 6.6p8; are you accepting
it per 6.6p10?

My front end and Comeau reject it with dagnostics like:

"/tmp/bug.c", line 10: error: expression must be an arithmetic constant
       {(int) &dblfault_tss},
        ^
"/tmp/bug.c", line 11: error: expression must be an arithmetic constant
       { (int)xpto},
         ^

Neil.



More information about the cfe-commits mailing list