public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed @ 2006-12-06 16:04 midoegal at web dot de 2006-12-06 23:14 ` [Bug middle-end/30086] " pinskia at gcc dot gnu dot org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: midoegal at web dot de @ 2006-12-06 16:04 UTC (permalink / raw) To: gcc-bugs When compiling GDB 6.5.90 on x86 (FC5) GCC gives following warning. So it is needed to initialize tmp_obstack to avoid this warning. This isn't necessary and GCC should detect this. /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c: In function 'pascal_object_print_value_fields': /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.alloc_failed' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.maybe_empty_object' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.use_extra_arg' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.extra_arg' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.freefun' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.chunkfun' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.alignment_mask' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.temp' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.chunk_limit' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.next_free' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.object_base' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.chunk' may be used uninitialized in this function /home/user/gdb/6.5.90/gdb-6.5.90/gdb/p-valprint.c:756: warning: 'tmp_obstack.chunk_size' may be used uninitialized in this function make[2]: *** [p-valprint.o] Error 1 make[2]: Leaving directory `/home/user/gdb/6.5.90/gdb-6.5.90/build_werr/gdb' make[1]: *** [all-gdb] Error 2 make[1]: Leaving directory `/home/user/gdb/6.5.90/gdb-6.5.90/build_werr' make: *** [all] Error 2 -- Summary: Initialize struct to avoid warnings shouldn't be needed Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: midoegal at web dot de GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30086 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/30086] Initialize struct to avoid warnings shouldn't be needed 2006-12-06 16:04 [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed midoegal at web dot de @ 2006-12-06 23:14 ` pinskia at gcc dot gnu dot org 2006-12-07 9:54 ` midoegal at web dot de ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-12-06 23:14 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from pinskia at gcc dot gnu dot org 2006-12-06 23:14 ------- Depends how the source looks, it might be actually used uninitialized which means the code is undefined anyways. Can you attach the preprocessed source? I have seen stuff like: struct a{int t; int t1}; void f(struct a); void g(void) { struct a b; b.t = 1; f(b); } (maybe a little more complex but you get the idea). How does GCC know that not all the elements of b are not used. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c |middle-end http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30086 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/30086] Initialize struct to avoid warnings shouldn't be needed 2006-12-06 16:04 [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed midoegal at web dot de 2006-12-06 23:14 ` [Bug middle-end/30086] " pinskia at gcc dot gnu dot org @ 2006-12-07 9:54 ` midoegal at web dot de 2006-12-07 9:55 ` midoegal at web dot de 2006-12-13 7:31 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: midoegal at web dot de @ 2006-12-07 9:54 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from midoegal at web dot de 2006-12-07 09:54 ------- Created an attachment (id=12764) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12764&action=view) Source file mentioned in the description -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30086 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/30086] Initialize struct to avoid warnings shouldn't be needed 2006-12-06 16:04 [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed midoegal at web dot de 2006-12-06 23:14 ` [Bug middle-end/30086] " pinskia at gcc dot gnu dot org 2006-12-07 9:54 ` midoegal at web dot de @ 2006-12-07 9:55 ` midoegal at web dot de 2006-12-13 7:31 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: midoegal at web dot de @ 2006-12-07 9:55 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from midoegal at web dot de 2006-12-07 09:55 ------- I attached the file. Its from GDB 6.5.90 release. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30086 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/30086] Initialize struct to avoid warnings shouldn't be needed 2006-12-06 16:04 [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed midoegal at web dot de ` (2 preceding siblings ...) 2006-12-07 9:55 ` midoegal at web dot de @ 2006-12-13 7:31 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-12-13 7:31 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2006-12-13 07:31 ------- The problem here is the same as PR 5035 really, just this case has structs and the other case is for scalars but the problems are the same. *** This bug has been marked as a duplicate of 5035 *** -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30086 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-12-13 7:31 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-12-06 16:04 [Bug c/30086] New: Initialize struct to avoid warnings shouldn't be needed midoegal at web dot de 2006-12-06 23:14 ` [Bug middle-end/30086] " pinskia at gcc dot gnu dot org 2006-12-07 9:54 ` midoegal at web dot de 2006-12-07 9:55 ` midoegal at web dot de 2006-12-13 7:31 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).