Alexander, On Tue, Jan 27, 2015 at 08:14:39PM +0200, Alexander Klimov wrote: > Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127 > fails with > > In file included from symfile.c:32:0: > symfile.c: In function 'unmap_overlay_command': > objfiles.h:628:3: error: 'sec' may be used uninitialized in this > function [-Werror=maybe-uninitialized] > for (osect = objfile->sections; osect < objfile->sections_end; osect++) \ > ^ > symfile.c:3442:23: note: 'sec' was declared here > struct obj_section *sec; > ^ > cc1: all warnings being treated as errors > make[2]: *** [symfile.o] Error 1 > make[2]: Leaving directory `gdb/gdb' > > While the bug was reported to GCC as > , > the attached patch simply initializes sec with NULL. Thanks for the patch. In deciding whether to apply this patch, I considered the fact that GCC 5 is currently unreleased, and so I would probably questioned the idea of a workaround more if it was more intrusive. But since this patch is very very simple, I did not see the harm. So I tested the patch on x86_64 and pushed it. I'm not really sure whether we might want it for 7.9 or not. I think that'll depend on the likeliness of GCC being fixed by the time GCC 5 gets released. If we don't know, I'm not opposed to pushing this one to 7.9 as well. A few comments, for next time: - I didn't check whether you have a copyright assignment on file for the GDB project or not. This pach is very small, and therefore I applied it under the "tiny patch" rule, where we consider patches smaller than 10-15 lines to not be legally significant. If you do not have a copyright assignment on file and you are thinking of making other contributions to GDB, please contact me in private, and I'll send you the form to get started. The process takes a few weeks. - In terms of submitting the patch, we'd like revision log of the commit be a full description of what the commit does, what problem it solves, how and why. The nice thing about it is that you can usually just "git send-email" it to the list. In this particular case, I used the contents of your of your email for the revision log. - Notice also that I've attached a ChangeLog entry. We require ChangeLog entries at time of patch submission, as we often use them to see what's changed, and it also allows us to check that they are properly formatted and complete. There are two documents that should be useful for helping you understand how to help us integrate your patches: gdb/CONTRIBUTE https://sourceware.org/gdb/wiki/ContributionChecklist If it looks a bit overwhelming, no worries, we're around to guide you through them. gdb/ChangeLog: * symfile.c (unmap_overlay_command): Initialize sec to NULL. Tested on x86_64-linux and pushed to master. -- Joel