fte-team / fteqw

This is the official GitHub mirror for the FTEQW project.
https://www.fteqw.org/
180 stars 55 forks source link

common.c: error: format not a string literal and no format arguments [-Werror=format-security] #40

Closed Xylemon closed 1 year ago

Xylemon commented 1 year ago

https://sourceforge.net/p/fteqw/tickets/29/

professorkaos64 wrote on 2016-07-27:

This works fine manually, but dpkg/debuild checks for -Werror=format-security. There is an issue with common.c.

make -C engine sv-rel -j4 PREFIX=/usr make -C engine gl-rel -j4 PREFIX=/usr

/tmp/buildd/ftequake-0.1.0+20160727git+bsos/engine/common/com_mesh.c: In function 'Mod_Trace':
/tmp/buildd/ftequake-0.1.0+20160727git+bsos/engine/common/com_mesh.c:2254:18: warning: unused variable 'best' [-Wunused-variable]
     unsigned int best = 0, v, w, i;
                  ^
/tmp/buildd/ftequake-0.1.0+20160727git+bsos/engine/common/common.c: In function 'Sys_ErrorThread':
/tmp/buildd/ftequake-0.1.0+20160727git+bsos/engine/common/common.c:5072:2: error: format not a string literal and no format arguments [-Werror=format-security]
  Sys_Error(data);
  ^
cc1: some warnings being treated as errors
Xylemon commented 1 year ago

professorkaos64 wrote on 2016-07-27:

Normally, this would be

Sys_Error("Not on main thread: %s", msg);

So I believe the fix here is:

Sys_Error("%s",data);

patch: https://github.com/ProfessorKaos64/LibreGeek-Packaging/blob/brewmaster/ftequake/debian/patches/fix-string-format   Last edit: Mikey D 2016-07-27