This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, C] Fix PR40563
2010/7/28 Shujing Zhao <firstname.lastname@example.org>:
> On 07/27/2010 09:58 PM, Joseph S. Myers wrote:
>> On Wed, 21 Jul 2010, Shujing Zhao wrote:
>>> Index: c-decl.c
>>> --- c-decl.c ? ?(revision 162361)
>>> +++ c-decl.c ? ?(working copy)
>>> @@ -4103,6 +4103,35 @@ start_decl (struct c_declarator *declara
>>> ? return tem;
>>> ?+/* Subroutine of finish_decl. Diagnose uninitialized const member of
>>> type TYPE.
>>> + ? DECL is the original declaration. */
>> This comment is unclear. ?What you seem to mean is: TYPE is the type of an
>> uninitialized object DECL. ?If that object has a const member, diagnose
>> Why do you need to recurse down among fields? ?Why isn't checking
>> C_TYPE_FIELDS_READONLY enough?
> It used to notice which field should be initialized, just like the
> diagnostics at c++. If the notice is not very necessary,
> C_TYPE_FIELDS_READONLY is enough.
>> What if the original uninitialized object is not a structure but an array
>> of structures? ?Will you diagnose things in that case?
> C++ would not error an uninitialized array of structure that has a const
> member. ?So I think it doesn't need warn at C?
It seems to be PR c++/43719, which should be fixed on mainline.