http://bugs.winehq.org/show_bug.cgi?id=16336
Summary: advpack/tests/install: format not a string literal and no format arguments Product: Wine Version: 1.1.9 Platform: PC OS/Version: Linux Status: NEW Keywords: download, patch, source Severity: minor Priority: P2 Component: build-env AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strength-reduce -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -Wtype-limits -Wpointer-arith -Werror -o install.o install.c cc1: warnings being treated as errors install.c: In function ‘append_str’: install.c:60: error: format not a string literal and no format arguments make[2]: *** [install.o] Error 1 make[2]: Leaving directory `/home/austin/wine-git/dlls/advpack/tests' make[1]: *** [advpack/tests] Error 2 make[1]: Leaving directory `/home/austin/wine-git/dlls' make: *** [dlls] Error 2
Attached patch fixes the issue, but may not be a proper fix.
Only occurs on gcc 4.3+
http://bugs.winehq.org/show_bug.cgi?id=16336
--- Comment #1 from Austin English austinenglish@gmail.com 2008-12-04 19:53:22 --- Created an attachment (id=17641) --> (http://bugs.winehq.org/attachment.cgi?id=17641) patch
http://bugs.winehq.org/show_bug.cgi?id=16336
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
--- Comment #2 from Vincent Povirk madewokherd@gmail.com 2008-12-04 20:19:08 --- The proper fix is most likely to use strcpy() or a similar (copy) function. sprintf() is not needed here.
http://bugs.winehq.org/show_bug.cgi?id=16336
--- Comment #3 from Vitaliy Margolen vitaliy@kievinfo.com 2008-12-04 20:36:44 --- What's wrong with good 'ol strcpy and strcat? That whole append_str() function should go and instead do something like:
strcpy(data, "[Version]\n"); strcat(data, "Signature="$Chicago$"\n"); strcat(data, "AdvancedINF=2.5\n"); strcat(data, "[DefaultInstall]\n"); strcat(data, "CheckAdminRights=1\n");
Or better yet make it a static const char:
static const char data[] = "[Version]\n" "Signature="$Chicago$"\n" "AdvancedINF=2.5\n" "[DefaultInstall]\n" "CheckAdminRights=1\n"; .. WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL);
http://bugs.winehq.org/show_bug.cgi?id=16336
--- Comment #4 from Vincent Povirk madewokherd@gmail.com 2008-12-04 21:25:19 --- Good point, in fact I'll go send in some patches that do exactly that. :)
http://bugs.winehq.org/show_bug.cgi?id=16336
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #5 from Austin English austinenglish@gmail.com 2008-12-05 12:09:47 --- Fixed, thanks Vincent!
http://bugs.winehq.org/show_bug.cgi?id=16336
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2008-12-20 09:06:10 --- Closing bugs fixed in 1.1.11.