public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/94769] New: Possible use of uninitialized variable num
@ 2020-04-26  8:31 stefansf at linux dot ibm.com
  2020-04-26 16:56 ` [Bug fortran/94769] " kargl at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: stefansf at linux dot ibm.com @ 2020-04-26  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94769
           Summary: Possible use of uninitialized variable num
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefansf at linux dot ibm.com
  Target Milestone: ---

In function check_io_constraints local variable num is supposed to be
initialized by function compare_to_allowed_values. While bootstrapping GCC on
S/390 I get the following warning/error:

gcc/fortran/io.c: In function 'bool gfc_resolve_dt(gfc_code*, gfc_dt*,
locus*)':
gcc/fortran/io.c:3857:7: error: 'num' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
 3857 |       if (num == 0)
      |       ^~       
gcc/fortran/io.c:3843:11: note: 'num' was declared here
 3843 |       int num;

I'm not sure whether a sensible default value for num should be 0 or 1.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-30  9:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26  8:31 [Bug fortran/94769] New: Possible use of uninitialized variable num stefansf at linux dot ibm.com
2020-04-26 16:56 ` [Bug fortran/94769] " kargl at gcc dot gnu.org
2020-04-26 17:10 ` schwab@linux-m68k.org
2020-04-27  6:27 ` stefansf at linux dot ibm.com
2020-04-27 16:07 ` sgk at troutmask dot apl.washington.edu
2020-04-27 17:12 ` tkoenig at gcc dot gnu.org
2020-04-27 17:37 ` sgk at troutmask dot apl.washington.edu
2020-04-27 18:05 ` stefansf at linux dot ibm.com
2020-04-28 12:01 ` stefansf at linux dot ibm.com
2020-04-29 14:41 ` cvs-commit at gcc dot gnu.org
2020-04-30  9:32 ` stefansf at linux dot ibm.com

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).