Make warnings

25 views
Skip to first unread message

Donald Montaine

unread,
Apr 2, 2022, 1:10:05 AM4/2/22
to ScarletDME
Just did a clone of the dev branch.  This is the output I got when I did  a make. Don't know if this is a problem or not.

make
Compiling analyse.o, 64 bit target.
Compiling b64.o, 64 bit target.
Compiling clopts.o, 64 bit target.
Compiling ctype.o, 64 bit target.
Compiling dh_ak.o, 64 bit target.
./gplsrc/dh_ak.c: In function ‘delete_ak’:
./gplsrc/dh_ak.c:1968:22: warning: ‘~’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
 1968 |   sprintf(path, "%s%c~%d", (relocated) ? header.akpath : pathname, DS, (int)(akno + AK_BASE_SUBFILE));
      |                      ^
./gplsrc/dh_ak.c:1968:17: note: directive argument in the range [-32766, 32769]
 1968 |   sprintf(path, "%s%c~%d", (relocated) ? header.akpath : pathname, DS, (int)(akno + AK_BASE_SUBFILE));
      |                 ^~~~~~~~~
./gplsrc/dh_ak.c:1968:3: note: ‘sprintf’ output between 4 and 264 bytes into a destination of size 256
 1968 |   sprintf(path, "%s%c~%d", (relocated) ? header.akpath : pathname, DS, (int)(akno + AK_BASE_SUBFILE));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling dh_clear.o, 64 bit target.
Compiling dh_close.o, 64 bit target.
Compiling dh_creat.o, 64 bit target.
Compiling dh_del.o, 64 bit target.
Compiling dh_exist.o, 64 bit target.
Compiling dh_file.o, 64 bit target.
Compiling dh_hash.o, 64 bit target.
Compiling dh_misc.o, 64 bit target.
Compiling dh_open.o, 64 bit target.
Compiling dh_read.o, 64 bit target.
Compiling dh_selct.o, 64 bit target.
Compiling dh_split.o, 64 bit target.
Compiling dh_write.o, 64 bit target.
Compiling ingroup.o, 64 bit target.
Compiling inipath.o, 64 bit target.
Compiling k_error.o, 64 bit target.
Compiling k_funcs.o, 64 bit target.
Compiling linuxio.o, 64 bit target.
Compiling linuxlb.o, 64 bit target.
Compiling linuxprt.o, 64 bit target.
Compiling lnx.o, 64 bit target.
./gplsrc/lnx.c: In function ‘qmsendmail’:
./gplsrc/lnx.c:66:30: warning: ‘%d’ directive writing between 1 and 6 bytes into a region of size 5 [-Wformat-overflow=]
   66 |   sprintf(tempname, ".qm_mail%d", my_uptr->uid);
      |                              ^~
./gplsrc/lnx.c:66:21: note: directive argument in the range [-32768, 32767]
   66 |   sprintf(tempname, ".qm_mail%d", my_uptr->uid);
      |                     ^~~~~~~~~~~~
./gplsrc/lnx.c:66:3: note: ‘sprintf’ output between 10 and 15 bytes into a destination of size 13
   66 |   sprintf(tempname, ".qm_mail%d", my_uptr->uid);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling lnxport.o, 64 bit target.
Compiling messages.o, 64 bit target.
Compiling netfiles.o, 64 bit target.
Compiling object.o, 64 bit target.
Compiling objprog.o, 64 bit target.
Compiling op_arith.o, 64 bit target.
Compiling op_array.o, 64 bit target.
Compiling op_btree.o, 64 bit target.
Compiling op_ccall.o, 64 bit target.
Compiling op_chnge.o, 64 bit target.
Compiling op_config.o, 64 bit target.
Compiling op_debug.o, 64 bit target.
Compiling op_dio1.o, 64 bit target.
Compiling op_dio2.o, 64 bit target.
Compiling op_dio3.o, 64 bit target.
Compiling op_dio4.o, 64 bit target.
Compiling op_exec.o, 64 bit target.
Compiling op_find.o, 64 bit target.
Compiling op_iconv.o, 64 bit target.
Compiling op_jumps.o, 64 bit target.
Compiling op_loads.o, 64 bit target.
./gplsrc/op_loads.c: In function ‘op_clrcom’:
./gplsrc/op_loads.c:195:25: warning: ‘%d’ directive writing between 1 and 6 bytes into a region of size 3 [-Wformat-overflow=]
  195 |   sprintf(block_name, "$%d", (int)cproc_level);
      |                         ^~
./gplsrc/op_loads.c:195:23: note: directive argument in the range [-32768, 32767]
  195 |   sprintf(block_name, "$%d", (int)cproc_level);
      |                       ^~~~~
./gplsrc/op_loads.c:195:3: note: ‘sprintf’ output between 3 and 8 bytes into a destination of size 4
  195 |   sprintf(block_name, "$%d", (int)cproc_level);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling op_locat.o, 64 bit target.
Compiling op_lock.o, 64 bit target.
Compiling op_logic.o, 64 bit target.
Compiling op_misc.o, 64 bit target.
./gplsrc/op_misc.c: In function ‘day_to_ddmmmyyyy’:
./gplsrc/op_misc.c:1746:34: warning: ‘%4d’ directive writing between 4 and 6 bytes into a region of size between 1 and 8 [-Wformat-overflow=]
 1746 |   sprintf(date_string, "%2d %.3s %4d", (int)day, month_names[mon - 1],
      |                                  ^~~
./gplsrc/op_misc.c:1746:24: note: directive argument in the range [-32768, 32767]
 1746 |   sprintf(date_string, "%2d %.3s %4d", (int)day, month_names[mon - 1],
      |                        ^~~~~~~~~~~~~~
./gplsrc/op_misc.c:1746:3: note: ‘sprintf’ output between 9 and 18 bytes into a destination of size 12
 1746 |   sprintf(date_string, "%2d %.3s %4d", (int)day, month_names[mon - 1],
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1747 |           (int)year);
      |           ~~~~~~~~~~
Compiling op_mvfun.o, 64 bit target.
Compiling op_oconv.o, 64 bit target.
Compiling op_seqio.o, 64 bit target.
Compiling op_sh.o, 64 bit target.
Compiling op_skt.o, 64 bit target.
Compiling op_sort.o, 64 bit target.
Compiling op_stop.o, 64 bit target.
Compiling op_str1.o, 64 bit target.
Compiling op_str2.o, 64 bit target.
Compiling op_str3.o, 64 bit target.
Compiling op_str4.o, 64 bit target.
Compiling op_str5.o, 64 bit target.
Compiling op_tio.o, 64 bit target.
./gplsrc/pdump.c: In function ‘pdump’:
./gplsrc/pdump.c:117:22: warning: ‘qmdump.’ directive writing 7 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
  117 |   sprintf(path, "%s%cqmdump.%d",
      |                      ^~~~~~~
./gplsrc/pdump.c:117:17: note: directive argument in the range [-32768, 32767]
  117 |   sprintf(path, "%s%cqmdump.%d",
      |                 ^~~~~~~~~~~~~~~
./gplsrc/pdump.c:117:3: note: ‘sprintf’ output between 10 and 270 bytes into a destination of size 256
  117 |   sprintf(path, "%s%cqmdump.%d",
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118 |           (pcfg.dumpdir[0] != '\0') ? pcfg.dumpdir : (sysseg->sysdir), DS,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119 |           process.user_no);
      |           ~~~~~~~~~~~~~~~~
Compiling qmlib.o, 64 bit target.
Compiling qmsem.o, 64 bit target.
Compiling qmtermlb.o, 64 bit target.
Compiling reccache.o, 64 bit target.
Compiling strings.o, 64 bit target.
Compiling telnet.o, 64 bit target.
Compiling time.o, 64 bit target.
Compiling to_file.o, 64 bit target.
Compiling txn.o, 64 bit target.
Compiling qmclilib.o with -fPIC
Linking qmclilib.so
Linking qmtic
Linking qmfix
Linking qmconv
./gplsrc/qmidx.c: In function ‘cross_check’:
./gplsrc/qmidx.c:423:30: warning: ‘~’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
  423 |       sprintf(pathname, "%s%c~%d", (path[0] != '\0') ? path : data_path, DS, SF(ak));
      |                              ^
./gplsrc/qmidx.c:423:25: note: directive argument in the range [-32765, 33]
  423 |       sprintf(pathname, "%s%c~%d", (path[0] != '\0') ? path : data_path, DS, SF(ak));
      |                         ^~~~~~~~~
./gplsrc/qmidx.c:423:7: note: ‘sprintf’ output between 4 and 264 bytes into a destination of size 256
  423 |       sprintf(pathname, "%s%c~%d", (path[0] != '\0') ? path : data_path, DS, SF(ak));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gplsrc/qmidx.c: In function ‘copy_indices’:
./gplsrc/qmidx.c:481:25: warning: ‘~’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
  481 |       sprintf(src, "%s%c~%d", (header.akpath[0] != '\0') ? header.akpath : data_path, DS, SF(ak));
      |                         ^
./gplsrc/qmidx.c:481:20: note: directive argument in the range [-32765, 33]
  481 |       sprintf(src, "%s%c~%d", (header.akpath[0] != '\0') ? header.akpath : data_path, DS, SF(ak));
      |                    ^~~~~~~~~
./gplsrc/qmidx.c:481:7: note: ‘sprintf’ output between 4 and 264 bytes into a destination of size 256
  481 |       sprintf(src, "%s%c~%d", (header.akpath[0] != '\0') ? header.akpath : data_path, DS, SF(ak));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gplsrc/qmidx.c:491:25: warning: ‘~’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
  491 |       sprintf(tgt, "%s%c~%d", (ak_path[0] != '\0') ? ak_path : data_path, DS, SF(ak));
      |                         ^
./gplsrc/qmidx.c:491:20: note: directive argument in the range [-32765, 33]
  491 |       sprintf(tgt, "%s%c~%d", (ak_path[0] != '\0') ? ak_path : data_path, DS, SF(ak));
      |                    ^~~~~~~~~
./gplsrc/qmidx.c:491:7: note: ‘sprintf’ output between 4 and 264 bytes into a destination of size 256
  491 |       sprintf(tgt, "%s%c~%d", (ak_path[0] != '\0') ? ak_path : data_path, DS, SF(ak));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Linking qmidx
Compiling qmlnxd.o, 64 bit target.
Linking qmlnxd
Compiling terminfo library
#[ QMTIC 2.6-6   Copyright, Ladybridge Systems, 2007.  All rights reserved. ]

Linking qm

geneb

unread,
Apr 2, 2022, 9:16:02 AM4/2/22
to ScarletDME
Don, can you tell me what version of gcc you're using? (gcc --version)
I'm using 10.2.1 and I'm not seeing the warnings that you are getting.
In looking at that line of code, it shouldn't even be complaining. "~"
isn't a directive, it's a string literal. The result of the sprintf
(which really should be an snprintf) is going to be something along the
lines of /some/pathname/~0 (or 1)

tnx.

g.



--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby. Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!

Donald Montaine

unread,
Apr 2, 2022, 10:36:33 AM4/2/22
to ScarletDME
gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)
Copyright (C) 2022 Free Software Foundation, Inc.

Donald Montaine

unread,
Apr 2, 2022, 10:43:51 AM4/2/22
to ScarletDME
Forgot to mention, running on Fedora 36 beta

geneb

unread,
Apr 2, 2022, 11:45:51 AM4/2/22
to ScarletDME
On Sat, 2 Apr 2022, Donald Montaine wrote:

> gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)
> Copyright (C) 2022 Free Software Foundation, Inc.
>
You might want to reach out to the gcc maintainers and let them know they
might have a bug on their hands. The parser shouldn't be interpreting a
string literal as an operator.
Reply all
Reply to author
Forward
0 new messages