Bug 15901 - Compile warnings
Summary: Compile warnings
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-24 16:27 UTC by Robert Hinson
Modified: 2023-12-24 16:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hinson 2023-12-24 16:27:54 UTC
CC      miscutils/i2c_tools.o
miscutils/i2c_tools.c: In function ‘list_i2c_busses_and_exit’:
miscutils/i2c_tools.c:1152:46: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=]
 1152 |                 snprintf(path, NAME_MAX, "%s/%s/name",
      |                                              ^~
miscutils/i2c_tools.c:1152:17: note: ‘snprintf’ output between 25 and 280 bytes into a destination of size 255
 1152 |                 snprintf(path, NAME_MAX, "%s/%s/name",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1153 |                          i2cdev_path, de->d_name);
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~
miscutils/i2c_tools.c:1157:38: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=]
 1157 |                                  "%s/%s/device/name",
      |                                      ^~
miscutils/i2c_tools.c:1156:25: note: ‘snprintf’ output between 32 and 287 bytes into a destination of size 255
 1156 |                         snprintf(path, NAME_MAX,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
 1157 |                                  "%s/%s/device/name",
      |                                  ~~~~~~~~~~~~~~~~~~~~
 1158 |                                  i2cdev_path, de->d_name);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~
miscutils/i2c_tools.c:1165:38: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=]
 1165 |                                  "%s/%s/device/name",
      |                                      ^~
miscutils/i2c_tools.c:1164:25: note: ‘snprintf’ output between 32 and 287 bytes into a destination of size 255
 1164 |                         snprintf(path, NAME_MAX,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
 1165 |                                  "%s/%s/device/name",
      |                                  ~~~~~~~~~~~~~~~~~~~~
 1166 |                                  i2cdev_path, de->d_name);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~
miscutils/i2c_tools.c:1177:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=]
 1177 |                                                  "%s/%s/device/%s/name",
      |                                                      ^~
miscutils/i2c_tools.c:1176:41: note: ‘snprintf’ output between 33 and 543 bytes into a destination of size 255
 1176 |                                         snprintf(path, NAME_MAX,
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
 1177 |                                                  "%s/%s/device/%s/name",
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~
 1178 |                                                  i2cdev_path, de->d_name,
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~
 1179 |                                                  subde->d_name);
      |                                                  ~~~~~~~~~~~~~~

---

  CC      modutils/modutils.o
modutils/modutils.c: In function ‘filename2modname’:
modutils/modutils.c:115:1: warning: function may return address of local variable [-Wreturn-local-addr]
  115 | }
      | ^
modutils/modutils.c:94:14: note: declared here
   94 |         char local_modname[MODULE_NAME_LEN];
      |              ^~~~~~~~~~~~~

---

  CC      networking/tftp.o
networking/tftp.c: In function ‘tftpd_main’:
networking/tftp.c:886:15: warning: ‘local_file’ is used uninitialized [-Wuninitialized]
  886 |         char *local_file = local_file;
      |               ^~~~~~~~~~
networking/tftp.c:886:15: note: ‘local_file’ was declared here
  886 |         char *local_file = local_file;
      |               ^~~~~~~~~~

---

  CC      procps/powertop.o
procps/powertop.c: In function ‘read_cstate_counts’:
procps/powertop.c:181:34: warning: ‘%s’ directive writing up to 255 bytes into a region of size 171 [-Wformat-overflow=]
  181 |                 sprintf(buf, "%s/%s/power", "/proc/acpi/processor", d->d_name);
      |                                  ^~
procps/powertop.c:181:17: note: ‘sprintf’ output between 28 and 283 bytes into a destination of size 192
  181 |                 sprintf(buf, "%s/%s/power", "/proc/acpi/processor", d->d_name);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---

  CC      shell/hush.o
shell/hush.c: In function ‘expand_one_var’:
shell/hush.c:6606:15: warning: ‘exp_word’ is used uninitialized [-Wuninitialized]
 6606 |         char *exp_word = exp_word; /* for compiler */
      |               ^~~~~~~~
shell/hush.c:6606:15: note: ‘exp_word’ was declared here
 6606 |         char *exp_word = exp_word; /* for compiler */
      |               ^~~~~~~~

---

  CC      util-linux/volume_id/btrfs.o
util-linux/volume_id/btrfs.c: In function ‘volume_id_probe_btrfs’:
util-linux/volume_id/btrfs.c:110:34: warning: ‘sb’ may be used uninitialized [-Wmaybe-uninitialized]
  110 |         volume_id_set_uuid(id, sb->fsid, UUID_DCE);
      |                                ~~^~~~~~
util-linux/volume_id/btrfs.c:93:35: note: ‘sb’ was declared here
   93 |         struct btrfs_super_block *sb;
      |                                   ^~

---

I don't know if you get any logs when compiling or not, but here are the ones that happen when I compile it.
Comment 1 Robert Hinson 2023-12-24 16:30:10 UTC
You don't have version 1.36.1 in the version dropdown, that is why I made it unspecified.