Wine 1.2-GIT: Compiler error in user32/painting.c

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Quix0r
Level 3
Level 3
Posts: 50
Joined: Sat May 10, 2008 8:23 am

Wine 1.2-GIT: Compiler error in user32/painting.c

Post by Quix0r »

I got the following compiler error with Wine 1.2-GIT (up-to-date checkout):

Code: Select all

make[1]: Entering directory `/home/quix0r/git/wine/dlls/user32'
ccache gcc -m32 -c -I. -I. -I../../include -I../../include  -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith  -g -O0 -fPIC  -o painting.o painting.c
painting.c: In function ‘GetDCEx’:
painting.c:913: error: initializer element is not constant
make[1]: *** [painting.o] Error 1
make[1]: Leaving directory `/home/quix0r/git/wine/dlls/user32'
make: *** [dlls/user32] Error 2
It happens only with last commit, the previous one, previous day, does compile flawless.

Please help here. :)

Roland
mogorva
Level 4
Level 4
Posts: 107
Joined: Fri Oct 16, 2009 10:27 am

Post by mogorva »

It compiles without errors for me when using CFLAGS="-O2", instead of -O0.
Frédéric Delanoy

Wine 1.2-GIT: Compiler error in user32/painting.c

Post by Frédéric Delanoy »

On Sat, Jul 24, 2010 at 05:52, Quix0r <[email protected]> wrote:
I got the following compiler error with Wine 1.2-GIT (up-to-date checkout):

Code:
make[1]: Entering directory `/home/quix0r/git/wine/dlls/user32'
ccache gcc -m32 -c -I. -I. -I../../include -I../../include  -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith  -g -O0 -fPIC  -o painting.o painting.c
painting.c: In function ‘GetDCEx’:
painting.c:913: error: initializer element is not constant
make[1]: *** [painting.o] Error 1
make[1]: Leaving directory `/home/quix0r/git/wine/dlls/user32'
make: *** [dlls/user32] Error 2


It happens only with last commit, the previous one, previous day, does compile flawless.

Please help here. :)

Roland
I've the same problem here (as other people).

Just wait for Monday commit batch... it will hopefully be fixed by
then (or the misbehaving patch reverted)
Quix0r
Level 3
Level 3
Posts: 50
Joined: Sat May 10, 2008 8:23 am

Post by Quix0r »

Here is my patch to get it compiling even with -O0 (and what does have optimization to do with errors?):

Code: Select all

diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 5e57e7f..320a920 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -910,7 +910,7 @@ BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
 HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
 {
     static const DWORD clip_flags = DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW;
-    static const DWORD user_flags = clip_flags | DCX_NORESETATTRS; /* flags that can be set by user */
+    static const DWORD user_flags = DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW | DCX_NORESETATTRS; /* f
     struct dce *dce;
     BOOL bUpdateVisRgn = TRUE;
     HWND parent;
Quix0r
Level 3
Level 3
Posts: 50
Joined: Sat May 10, 2008 8:23 am

Post by Quix0r »

I know it looks silly and I know that the original coder wants to avoid such bad-style code but for my very basic knowledge in C/C++ it works.
James McKenzie

Wine 1.2-GIT: Compiler error in user32/painting.c

Post by James McKenzie »

Quix0r wrote:
I know it looks silly and I know that the original coder wants to avoid such bad-style code but for my very basic knowledge in C/C++ it works.

If you grab today's git release this should be fixed.

I did not do the fix, but I noticed it.

James McKenzie
Locked