Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 571792

Summary: [x11 overlay] xcb-util-cursor warning-as-error chokes on load_cursor.c
Product: Gentoo Linux Reporter: Robert White <rwhite>
Component: [OLD] LibraryAssignee: Gentoo X packagers <x11>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Add braces/scope to legalize variable declaration.

Description Robert White 2016-01-13 22:18:12 UTC
The below "declaration after statements" warning is easily fixed by adding a non-conditional block. Without the extra braces the declaration of the "elements" array is illegal. The declaration isn't subject to movement as the array size is determined dynamically.

Patch Attached.

Actual error message:

/var/tmp/portage/x11-libs/xcb-util-cursor-9999/work/xcb-util-cursor-9999/cursor/load_cursor.c: In function ‘xcb_cursor_load_cursor’:
/var/tmp/portage/x11-libs/xcb-util-cursor-9999/work/xcb-util-cursor-9999/cursor/load_cursor.c:226:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     xcb_render_animcursorelt_t elements[nimg];
     ^
make[1]: Leaving directory '/var/tmp/portage/x11-libs/xcb-util-cursor-9999/work/xcb-util-cursor-9999-abi_x86_32.x86/cursor'


Reproducible: Always
Comment 1 Robert White 2016-01-13 22:19:13 UTC
Created attachment 422840 [details, diff]
Add braces/scope to legalize variable declaration.
Comment 2 Matt Turner gentoo-dev 2017-01-29 06:44:04 UTC
Please send upstream to the XCB mailing list: https://lists.freedesktop.org/mailman/listinfo/xcb