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 2
Level 2
Posts: 49
Joined: Sat May 10, 2008 8:23 am
Location: Krefeld
Contact:

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

Post by Quix0r » Fri Jul 23, 2010 10:52 pm

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: 106
Joined: Fri Oct 16, 2009 10:27 am
Location: Hungary

Post by mogorva » Sat Jul 24, 2010 12:07 am

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 » Sat Jul 24, 2010 1:43 am

On Sat, Jul 24, 2010 at 05:52, Quix0r <wineforum-user@winehq.org> 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 2
Level 2
Posts: 49
Joined: Sat May 10, 2008 8:23 am
Location: Krefeld
Contact:

Post by Quix0r » Mon Jul 26, 2010 1:11 pm

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 2
Level 2
Posts: 49
Joined: Sat May 10, 2008 8:23 am
Location: Krefeld
Contact:

Post by Quix0r » Mon Jul 26, 2010 1:13 pm

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 » Mon Jul 26, 2010 9:06 pm

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