add -Werror to default compiler options

Maarten Lankhorst m.b.lankhorst at
Mon Sep 22 17:36:11 CDT 2008

Hi All,

Rob Shearman schreef:
> 2008/9/18 Austin English <austinenglish at>:
>> Should help avoid bugs like bug 15266 and promote more proper, portable code.
>> Tried compiling Wine with -Werror, got a few interesting results. First one:
>> austin at austin-desktop:~/wine-git/dlls/jscript$ make
>> gcc -c -I. -I. -I../../include -I../../include  -D__WINESRC__  -D_REENTRANT
>> -fPIC -Wall -Werror -pipe -fno-strict-aliasing -Wdeclaration-after-statement
>> -Wwrite-strings -Wpointer-arith  -g -O2  -o engine.o engine.c
>> cc1: warnings being treated as errors
>> engine.c: In function 'var_statement_eval':
>> engine.c:500: warning: 'hres' is used uninitialized in this function
> Or it could just be that they had a different compiler version to you
> and so the warning didn't appear for them. This is the trouble with
> using -Werror in an uncontrolled environment - a developer using one
> version of the compiler could commit code that compiles cleanly for
> them, but not for another developer using a different compiler version
> and so stop them from being able to build Wine. That's fine if we want
> to do it, but we have to consider whether it is worth the hassle for
> whatever increase in quality we get from it.
-Wall -Werror should not be in configure, some quick test found the 
following issues:

* xinerama, mesa, randr and alsa are no longer found.
* Various functions like snprintf, strcasecmp, strdup, strncasecmp, 
vsnprintf, memmove, are no longer found.
* EXTRACFLAGS no longer has -fno-strength-reduce

Until those things are addressed, I don't believe it's a good idea to 
enable those flags.

This was found by diffing config.status created with ./configure 
CFLAGS='-g -O2' and CFLAGS='-g -O2 -Wall -Werror'
config.status is created by configure, and it will create all other 
files like makefiles and config.h

If you want to build with -Wall -Werror, do "make CFLAGS='-g -O2 -Wall 
-Werror'". With -O0 some warnings that -Wall warns for are not shown 
because they require optimization.

The mesa "up-to-date" check seems to have been in since before the year 
2000, and as such I don't know if it's still required. I don't mind it 
being taken out.


More information about the wine-devel mailing list