public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: uninit variable warnings on gcc 11.3?
Date: Wed, 7 Dec 2022 17:37:10 -0800	[thread overview]
Message-ID: <Y5E/xhJyFIXN31oZ@magnolia> (raw)

Hi everyone,

I went on a spree of trying to build things with W=12e this afternoon,
and I noticed that gcc spat out the following warnings.  I can't tell if
these warnings are bogus noise or if they actually could cause problems,
particularly in the extent status tree bits.  That said, IIRC there's
been some mention of weirdness wrt that part of ext4, so I thought I
should mention this in case it's significant to anyone.

--D

In file included from /storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:33:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c: In function ‘ext4_ext_map_blocks’:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/ext4_extents.h:230:15: warning: ‘zero_ex2.ee_start_lo’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  230 |         block = le32_to_cpu(ex->ee_start_lo);
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:38: note: ‘zero_ex2.ee_start_lo’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                                      ^~~~~~~~
In file included from /storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:33:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/ext4_extents.h:231:19: warning: ‘zero_ex2.ee_start_hi’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  231 |         block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:38: note: ‘zero_ex2.ee_start_hi’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                                      ^~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3140:16: warning: ‘zero_ex2.ee_block’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3140 |         return ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3141 |                                      EXTENT_STATUS_WRITTEN);
      |                                      ~~~~~~~~~~~~~~~~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:38: note: ‘zero_ex2.ee_block’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                                      ^~~~~~~~
In file included from /storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:33:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/ext4_extents.h:230:15: warning: ‘zero_ex1.ee_start_lo’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  230 |         block = le32_to_cpu(ex->ee_start_lo);
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:28: note: ‘zero_ex1.ee_start_lo’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                            ^~~~~~~~
In file included from /storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:33:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/ext4_extents.h:231:19: warning: ‘zero_ex1.ee_start_hi’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  231 |         block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:28: note: ‘zero_ex1.ee_start_hi’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                            ^~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3140:16: warning: ‘zero_ex1.ee_block’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3140 |         return ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3141 |                                      EXTENT_STATUS_WRITTEN);
      |                                      ~~~~~~~~~~~~~~~~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/extents.c:3426:28: note: ‘zero_ex1.ee_block’ was declared here
 3426 |         struct ext4_extent zero_ex1, zero_ex2;
      |                            ^~~~~~~~
  CC [M]  fs/ext4/inode.o
  CC [M]  fs/ext4/ioctl.o
  CC [M]  fs/ext4/mballoc.o
  CC [M]  fs/ext4/migrate.o
  CC [M]  fs/ext4/mmp.o
  CC [M]  fs/ext4/move_extent.o
  CC [M]  fs/ext4/namei.o
  CC [M]  fs/ext4/readpage.o
  CC [M]  fs/ext4/page-io.o
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/inode.c: In function ‘ext4_page_mkwrite’:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/inode.c:6205:23: warning: ‘get_block’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 6205 |                 err = block_page_mkwrite(vma, vmf, get_block);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  fs/ext4/resize.o
  CC [M]  fs/ext4/super.o
  CC [M]  fs/ext4/symlink.o
  CC [M]  fs/ext4/sysfs.o
  CC [M]  fs/ext4/xattr.o
  CC [M]  fs/ext4/xattr_hurd.o
  CC [M]  fs/ext4/xattr_trusted.o
  CC [M]  fs/ext4/xattr_user.o
  CC [M]  fs/ext4/fast_commit.o
  CC [M]  fs/ext4/orphan.o
  CC [M]  fs/ext4/acl.o
  CC [M]  fs/ext4/xattr_security.o
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/super.c: In function ‘ext4_fill_super’:
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/super.c:5486:15: warning: ‘first_not_zeroed’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 5486 |         err = ext4_register_li_request(sb, first_not_zeroed);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/super.c:5042:22: note: ‘first_not_zeroed’ was declared here
 5042 |         ext4_group_t first_not_zeroed;
      |                      ^~~~~~~~~~~~~~~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/super.c:3253:46: warning: ‘logical_sb_block’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3253 |                 if (block_bitmap >= sb_block + 1 &&
      |                                     ~~~~~~~~~^~~
/storage/home/djwong/cdev/work/linux-xfs/fs/ext4/super.c:5036:22: note: ‘logical_sb_block’ was declared here
 5036 |         ext4_fsblk_t logical_sb_block;
      |                      ^~~~~~~~~~~~~~~~

                 reply	other threads:[~2022-12-08  1:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5E/xhJyFIXN31oZ@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox