[cfe-commits] r63242 - in /cfe/trunk: Driver/RewriteObjC.cpp include/clang/AST/Decl.h include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/Basic/DiagnosticSemaKinds.def lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/CodeGen/CGExprAgg.

Eli Friedman eli.friedman at gmail.com
Wed Jan 28 15:42:19 PST 2009


On Wed, Jan 28, 2009 at 3:37 PM, Douglas Gregor <dgregor at apple.com> wrote:
>> struct X { int a, b; };
>> struct X xs[] = { [0] = (struct X) { 1, 2 }, [0].b = 3 };
>>
>> In gnu89 mode in gcc, the init list is actually equivalent to "{1,
>> 3}".  clang, on the other hand, will give different results (although
>> it will also warn, so it might not be so bad).
>
> since both Clang and GCC
> get the answer { 0, 3} in their default invocation modes

gcc gets {1, 3}.  But yeah, it's probably not a big deal.

-Eli



More information about the cfe-commits mailing list