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: [C] improve missing initializers diagnostics


On Sat, Apr 21, 2012 at 4:58 AM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> This patch improves missing initializers diagnostics. From:
>
> pr36446.c:13:3: warning: missing initializer [-Wmissing-field-initializers]
> ? .h = {1},
> ? ^
> pr36446.c:13:3: warning: (near initialization for ‘m0.h.b’)
> [-Wmissing-field-initializers]
> ? .h = {1},
> ? ^
>
> to:
>
> pr36446.c:13:3: warning: missing initializer for field ‘b’ of ‘struct
> h’ [-Wmissing-field-initializers]
> ? .h = {1},
> ? ^
> pr36446.c:3:7: note: ‘b’ declared here
> ? int b;
> ? ? ? ^
>
> Bootstrapped/regression tested.
>
> OK?
>
>
> 2012-04-19 ?Manuel López-Ibáñez ?<manu@gcc.gnu.org>
>
> ? ? ? ?* c-typeck.c (pop_init_level): Improve diagnostics.
> testsuite/
> ? ? ? ?* gcc.dg/m-un-2.c: Update.
> ? ? ? ?* gcc.dg/20011021-1.c: Update.

On Linux/x86, revision 186808 gave me:

FAIL: gcc.dg/20011021-1.c  (test for warnings, line 34)
FAIL: gcc.dg/20011021-1.c  (test for warnings, line 41)
FAIL: gcc.dg/20011021-1.c  (test for warnings, line 44)
FAIL: gcc.dg/20011021-1.c (test for excess errors)
FAIL: gcc.dg/20011021-1.c near init (test for warnings, line 27)
FAIL: gcc.dg/20011021-1.c near init (test for warnings, line 30)
FAIL: gcc.dg/m-un-2.c (test for excess errors)
FAIL: gcc.dg/m-un-2.c warning regression 2 (test for warnings, line 12)
FAIL: gcc.dg/missing-field-init-2.c  (test for warnings, line 14)
FAIL: gcc.dg/missing-field-init-2.c  (test for warnings, line 7)
FAIL: gcc.dg/missing-field-init-2.c  (test for warnings, line 8)
FAIL: gcc.dg/missing-field-init-2.c (test for excess errors)

Revision 186806 is OK.


-- 
H.J.


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