| View previous topic :: View next topic |
| Author |
Message |
vh4x0r n00b


Joined: 11 May 2009 Posts: 37
|
Posted: Tue Nov 16, 2010 9:16 pm Post subject: gcc-4.5.1 and Xlib issues |
|
|
I was working on some code using Xlib, and I noticed a weird issue , which hadn't occurred until I recompiled my entire system using gcc-4.5.1. I wrote this code :
| Code: | #include <X11/Xlib.h>
int main ()
{
Display * d = XOpenDisplay (NULL);
int s = DefaultScreen (d);
Window w = XCreateSimpleWindow (d, RootWindow (d, s), 400, 200, 400, 300, 1,
BlackPixel (d, s), WhitePixel (d, s));
XEvent e;
GC arc_gc = XCreateGC (d, w, 0, 0);
XSetLineAttributes (d, arc_gc, 1, LineSolid, CapNotLast, JoinMiter);
XSelectInput (d, w, ExposureMask | KeyPressMask);
XMapWindow (d, w);
while (1)
{
XNextEvent (d, &e);
if (e.type == Expose)
XDrawArc (d, w, arc_gc, 50, 50, 100, 100, 0, 360*64);
if (e.type == KeyPress)
break;
}
XCloseDisplay (d);
return 0;
}
|
and the result I got was an arc with lots of stray lines . Curiously this doesn't occur when I don't set the thickness with XSetLineAttributes (). I'm pretty sure this didn't occur with gcc 4.4. Here are my package versions.
| Code: | [I] x11-libs/libX11
Available versions: 1.3.4 (~)1.3.6 {doc ipv6 static-libs test +xcb}
Installed versions: 1.3.6(13:13:31 10/12/10)(xcb -doc -ipv6 -static-libs -test)
Homepage: http://xorg.freedesktop.org/
Description: X.Org X11 library
[I] x11-base/xorg-server
Available versions: 1.7.6 1.7.7-r1 (~)1.8.2 [m](~)1.9.2 [m](~)1.9.2.901 {debug dmx doc hal ipv6 kdrive minimal nptl sdl static-libs tslib +udev xorg}
Installed versions: 1.8.2(06:19:47 10/15/10)(kdrive nptl udev xorg -dmx -doc -hal -ipv6 -minimal -static-libs -tslib)
Homepage: http://xorg.freedesktop.org/
Description: X.Org X servers
[U] sys-devel/gcc
Available versions:
(2.95) *2.95.3-r9 ~*2.95.3-r10!s
(3.1) *3.1.1-r2
(3.2) **3.2.2!s *3.2.3-r4
(3.3) (~)3.3.6-r1!s
(3.4) 3.4.6-r2!s
(4.0) ~*4.0.4!s
(4.1) 4.1.2!s
(4.2) (~)4.2.4-r1!s
(4.3) (~)4.3.3-r2!s 4.3.4!s (~)4.3.5!s
(4.4) (~)4.4.2!s 4.4.3-r2!s (~)4.4.3-r3!s (~)4.4.4-r1!s 4.4.4-r2!s (~)4.4.5!s
(4.5) {M}(~)4.5.1!s
{altivec bootstrap boundschecking build d doc fixed-point fortran gcj graphite gtk hardened ip28 ip32r10k java libffi lto mudflap multilib multislot n32 n64 nls nocxx nopie nossp nptl objc objc++ objc-gc openmp static test vanilla}
Installed versions: 4.4.3-r2(4.4)!s(16:37:03 10/07/10)(fortran mudflap multilib nls nptl openmp -altivec -bootstrap -build -doc -fixed-point -gcj -graphite -gtk -hardened -libffi -multislot -n32 -n64 -nocxx -objc -objc++ -objc-gc -test -vanilla) 4.5.1(4.5)!s(22:26:28 10/12/10)(doc fortran gcj graphite gtk lto mudflap multilib nls nptl openmp -altivec -bootstrap -build -fixed-point -hardened -libffi -multislot -n32 -n64 -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla)
Homepage: http://gcc.gnu.org/
Description: The GNU Compiler Collection
|
|
|
| Back to top |
|
 |
roarinelk Guru


Joined: 04 Mar 2004 Posts: 520
|
Posted: Wed Nov 17, 2010 2:15 pm Post subject: |
|
|
Works for me, both 4.4.5 and 4.5.1 draw a window with a circle inside.
Maybe it's a gfx driver and/or libX11 issue? (I use x11 git with the nvidia blob). |
|
| Back to top |
|
 |
vh4x0r n00b


Joined: 11 May 2009 Posts: 37
|
Posted: Wed Nov 17, 2010 2:57 pm Post subject: |
|
|
I have an integrated intel IGP (Intel HD graphics) with the Core i3 processor and xf86-video-intel-2.13.0. This graphics chip is relatively new , so that could be the problem too. _________________ main () { while (true) fork (); } |
|
| Back to top |
|
 |
xpace n00b

Joined: 20 Feb 2010 Posts: 5
|
|
| Back to top |
|
 |
vh4x0r n00b


Joined: 11 May 2009 Posts: 37
|
Posted: Sun Feb 20, 2011 2:01 pm Post subject: |
|
|
No, it still occurs with libX11-1.4.1, gcc-4.5.2, xf86-video-intel-2.14.0 and xorg-server-1.9.4
The only way to fix my code was to not change line attributes ... _________________ main () { while (true) fork (); } |
|
| Back to top |
|
 |
xpace n00b

Joined: 20 Feb 2010 Posts: 5
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|