Opened 2 months ago

Last modified 2 months ago

#864 new defect

Fix compiler warnings

Reported by: Bruno Cornec Owned by: Bruno Cornec
Priority: high Milestone: 3.3.1
Component: mondo Version: 3.3.0
Severity: major Keywords:
Cc:

Description

[fedora-30-x86_64] In file included from /usr/include/string.h:495,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:60,
[fedora-30-x86_64]                  from libmondo-archive.c:13:
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'call_mindi_to_supply_boot_disks' at libmondo-archive.c:489:4:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In file included from /usr/include/string.h:495,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:60,
[fedora-30-x86_64]                  from libmondo-cli.c:13:
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:468:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:516:5:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:663:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:674:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 512 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:682:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:697:4:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:688:4:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:793:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 512 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:797:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 512 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'process_switches' at libmondo-cli.c:827:3:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 512 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] libmondo-devices.c: In function 'interactively_obtain_media_parameters_from_user':
[fedora-30-x86_64] libmondo-devices.c:2562:32: warning: '/netfsdir' directive writing 9 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
[fedora-30-x86_64]  2562 |    sprintf(bkpinfo->isodir, "%s/netfsdir", bkpinfo->tmpdir);
[fedora-30-x86_64]       |                                ^~~~~~~~~
[fedora-30-x86_64] In file included from /usr/include/stdio.h:867,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:40,
[fedora-30-x86_64]                  from libmondo-devices.c:13:
[fedora-30-x86_64] /usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 10 and 137 bytes into a destination of size 128
[fedora-30-x86_64]    36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64]    37 |       __bos (__s), __fmt, __va_arg_pack ());
[fedora-30-x86_64]       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] In file included from /usr/include/string.h:495,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:60,
[fedora-30-x86_64]                  from libmondo-devices.c:13:
[fedora-30-x86_64] In function 'strncpy',
[fedora-30-x86_64]     inlined from 'interactively_obtain_media_parameters_from_user' at libmondo-devices.c:2738:4:
[fedora-30-x86_64] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound 128 equals destination size [-Wstringop-truncation]
[fedora-30-x86_64]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change History (1)

comment:1 Changed 2 months ago by Bruno Cornec

[fedora-30-x86_64] mondo-rstr-tools.c: In function 'read_cfg_file_into_bkpinfo':
[fedora-30-x86_64] mondo-rstr-tools.c:747:35: warning: '%s' directive writing up to 511 bytes into a region of size 128 [-Wformat-overflow=]
[fedora-30-x86_64]   747 |   sprintf(bkpinfo->media_device, "%s1", value);
[fedora-30-x86_64]       |                                   ^~    ~~~~~
[fedora-30-x86_64] In file included from /usr/include/stdio.h:867,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:40,
[fedora-30-x86_64]                  from mondo-rstr-tools.c:7:
[fedora-30-x86_64] /usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 2 and 513 bytes into a destination of size 128
[fedora-30-x86_64]    36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64]    37 |       __bos (__s), __fmt, __va_arg_pack ());
[fedora-30-x86_64]       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] mondo-rstr-tools.c:929:28: warning: '%s' directive writing up to 511 bytes into a region of size 128 [-Wformat-overflow=]
[fedora-30-x86_64]   929 |  sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
[fedora-30-x86_64]       |                            ^~     ~~~~~~~
[fedora-30-x86_64] In file included from /usr/include/stdio.h:867,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:40,
[fedora-30-x86_64]                  from mondo-rstr-tools.c:7:
[fedora-30-x86_64] /usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 1 and 1023 bytes into a destination of size 128
[fedora-30-x86_64]    36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64]    37 |       __bos (__s), __fmt, __va_arg_pack ());
[fedora-30-x86_64]       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64] mondo-rstr-tools.c:984:30: warning: '%s' directive writing up to 511 bytes into a region of size 128 [-Wformat-overflow=]
[fedora-30-x86_64]   984 |    sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
[fedora-30-x86_64]       |                              ^~     ~~~~~~~
[fedora-30-x86_64] In file included from /usr/include/stdio.h:867,
[fedora-30-x86_64]                  from ../../src/include/my-stuff.h:40,
[fedora-30-x86_64]                  from mondo-rstr-tools.c:7:
[fedora-30-x86_64] /usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 1 and 1023 bytes into a destination of size 128
[fedora-30-x86_64]    36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[fedora-30-x86_64]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[fedora-30-x86_64]    37 |       __bos (__s), __fmt, __va_arg_pack ());
[fedora-30-x86_64]       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: See TracTickets for help on using tickets.