cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.4k stars 293 forks source link

Fix cxmon -Wformat-security error when building with gcc 10.2.0 #237

Closed lukateras closed 3 years ago

lukateras commented 3 years ago

This patch replaces a call to fprintf() with a non-format prompt argument with corresponding fputs. This resolves a compilation error with the latest GCC version. Also see this FAQ.

./../../../cxmon/src/mon.cpp: In function 'void read_line(char*)':
./../../../cxmon/src/mon.cpp:285:24: error: format not a string literal and no format arguments [https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security>
  285 |  fprintf(monout, prompt);
      |                        ^

Let me know if you prefer this patch or fprintf(monout, "%s", prompt);.