Skip to content
Snippets Groups Projects
Commit 10562789 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Eliminte weird gcc (12.2) warning in release build (only)

Increasing size of mode[] element by 2 bytes eliminated these GCC warnings
that seem like false-positives to me:

sbbs.h:194:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  194 |                                 (ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
js_file.c:225:25: note: in expansion of macro ‘JSSTRING_TO_STRBUF’
  225 |                         JSSTRING_TO_STRBUF(cx, str, p->mode, sizeof(p->mode), NULL);
      |                         ^~~~~~~~~~~~~~~~~~
js_file.c:42:17: note: at offset 5 into destination object ‘mode’ of size 5
   42 |         char    mode[5];
      |                 ^~~~

Similar use of JSSTRING_TO_STRBUF in other files (js_console.cpp, js_archive.c)
(with larger target buffers) does not trigger the same warnings.
parent e1bd17e3
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ typedef struct
{
FILE* fp;
char name[MAX_PATH+1];
char mode[5];
char mode[7];
uchar etx;
BOOL debug;
BOOL rot13;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment