Supermodel icon indicating copy to clipboard operation
Supermodel copied to clipboard

fixed `-Wformat-overflow` compiler warnings / added missing newline to log messages

Open firewave opened this issue 2 years ago • 3 comments

Some examples for reference:

Src/OSD/SDL/Main.cpp:1086:30: warning: ‘ (Paused)’ directive writing 9 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
 1086 |         sprintf(titleStr, "%s (Paused)", baseTitleStr);
      |                              ^~~~~~~~~
Src/OSD/SDL/Main.cpp:1086:16: note: ‘sprintf’ output between 10 and 137 bytes into a destination of size 128
 1086 |         sprintf(titleStr, "%s (Paused)", baseTitleStr);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Src/OSD/Logger.cpp:382:29: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 4088 [-Wformat-overflow=]
  382 |   sprintf(string2, "[Error] %s\n", string1);
      |                             ^~     ~~~~~~~
Src/OSD/Logger.cpp:382:10: note: ‘sprintf’ output between 10 and 4105 bytes into a destination of size 4096
  382 |   sprintf(string2, "[Error] %s\n", string1);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

firewave avatar Dec 02 '23 18:12 firewave

Will you be able to make the suggested changes?

trzy avatar Mar 10 '24 03:03 trzy

Will you be able to make the suggested changes?

Yes. Hopefully I finally get to it this week.

firewave avatar Mar 11 '24 13:03 firewave

There are additional warnings now but I cannot change that file because there are some issues with the line endings.

Src/Debugger/CPU/68KDebug.cpp:1353:56: note: ‘sprintf’ output between 15 and 64 bytes into a destination of size 50
 1353 |                                                 sprintf(moveStr, "movem.%c %s,[AM2]", sizeC, regList);
      |                                                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

firewave avatar Mar 30 '24 20:03 firewave