[schilytools] Compiler Warnings

Friedhelm Mehnert lists at friedhelms.net
Fri Dec 9 11:51:25 CET 2022


Hello,

while building the Schilytools under linux Devuan/Ceres (Debian/Sid) for
amd_64, which uses gcc 12.1.0, I see some compiler warnings I think I
haven't seen before.

I'm unsure if they are harmless or if there should be something done
about them.

It builds and seems to run ok anyway.

[...]
>      ==> COMPILING "OBJ/amd64-linux-gcc/md5.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/rmd160.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/sha1.o"
> In function 'SHA1Update',
>     inlined from 'SHA1Pad' at sha1.c:253:3:
> sha1.c:228:25: warning: 'SHA1Transform' reading 64 bytes from a region of size 1 [-Wstringop-overrea
> d]
>   228 |                         SHA1Transform(context->state, (UInt8_t *)&data[i]);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sha1.c:228:25: note: referencing argument 2 of type 'const uint8_t[64]' {aka 'const unsigned char[64
> ]'}
> sha1.c: In function 'SHA1Pad':
> sha1.c:132:1: note: in a call to function 'SHA1Transform'
>   132 | SHA1Transform(state, buffer)
>       | ^~~~~~~~~~~~~
> In function 'SHA1Update',
>     inlined from 'SHA1Pad' at sha1.c:253:3,
>     inlined from 'SHA1Final' at sha1.c:264:2:
> sha1.c:228:25: warning: 'SHA1Transform' reading 64 bytes from a region of size 1 [-Wstringop-overrea
> d]
>   228 |                         SHA1Transform(context->state, (UInt8_t *)&data[i]);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sha1.c:228:25: note: referencing argument 2 of type 'const uint8_t[64]' {aka 'const unsigned char[64
> ]'}
> sha1.c: In function 'SHA1Final':
> sha1.c:132:1: note: in a call to function 'SHA1Transform'
>   132 | SHA1Transform(state, buffer)
>       | ^~~~~~~~~~~~~
>         ==> COMPILING "OBJ/amd64-linux-gcc/sha2.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/sha3.o"

[...]

>         ==> COMPILING "OBJ/amd64-linux-gcc/globals.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/implicit.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/macro.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/main.o"
> In file included from ../../../include/mksh/defs.h:56,
>                  from ../../../include/mk/defs.h:51,
>                  from main.cc:91:
> main.cc: In function 'void setup_for_projectdir()':
> main.cc:2264:55: warning: '__builtin___sprintf_chk' may write a terminating nul past the end of the 
> destination [-Wformat-overflow=]
>  2264 |                        (void) sprintf(path, NOCATGETS("%s/%s"), cwdpath,sccs_dir_path);
> ../../../../include/avo/intl.h:67:26: note: in definition of macro 'NOCATGETS'
>    67 | #define NOCATGETS(str)  (str)
>       |                          ^~~
> In file included from /usr/include/stdio.h:906,
>                  from ../../../../../include/schily/stdio.h:39,
>                  from ../../../include/mksh/defs.h:60:
> In function 'int sprintf(char*, const char*, ...)',
>     inlined from 'void setup_for_projectdir()' at main.cc:2264:24:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:30:34: note: '__builtin___sprintf_chk' output 2 or more 
> bytes (assuming 4097) into a destination of size 4096
>    30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    31 |                                   __glibc_objsize (__s), __fmt,
>       |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    32 |                                   __va_arg_pack ());
>       |                                   ~~~~~~~~~~~~~~~~~
>         ==> COMPILING "OBJ/amd64-linux-gcc/make.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/misc.o"
>         ==> COMPILING "OBJ/amd64-linux-gcc/nse.o"


Best Regards
Friedhelm



More information about the schilytools mailing list