[Bug c/68425] Enhanced error message when an array is initialized with too many elements

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 19 03:08:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68425

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |easyhack
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-11-19
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Morwenn from comment #0)

It does say "[2]", no? It could say "too many initializers (3) for 'const int
[2]'"

> I guess that it is rather cheap to implement and can help to diagnose the
> actual problem faster.

If you guess that, you should really give it a try :)

Just launch cc1 under gdb, break at the line that prints that message and
figure out how to find out the number of initializers. Then follow:

https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps


More information about the Gcc-bugs mailing list