[Xfce4-commits] r29924 - in xfce4-dev-tools/trunk: . m4macros

Brian J. Tarricone brian at tarricone.org
Mon May 4 23:02:10 CEST 2009


Ali Abdallah wrote:
> 
> I just finish from making the current svn of xfpm compiling with these 
> changes that you made, however i had
> a problem concerning the macro XSyncValueAdd for the xsync extension, 
> they have comparison between unsigned and signed int in this macro, 
> xfwm4 is also affected by this and it won't compile with debug=full.
> 
> Apart from undeffing and deffing the macro, do you better idea.

Crap, that's an icky one.  Arguably, the macro is buggy -- the first 
line (int t = (a).lo;) is bad since it could potentially truncate a.lo, 
or misinterpret it as a negative value.

But of course in practice that doesn't help anything...  the bug is 
still there and it still causes a compile failure.

I'm not sure what to do here; one of the actual real-world bugs that I 
found was actually related to a signed vs. unsigned comparison, so I'd 
hesitate to disable that.

I wonder if there's an easy way to filter a flag out when compiling a 
specific file.

If not, at worse, I guess I could add an argument to XDT_FEATURE_DEBUG() 
that lets you specify flags that you don't want, ever (or flags that 
you'd like to add).  But that sounds like it might be a bit much.

Anyone else have any thoughts on this?

Ali, on a side note... looking at my headers, I see that XSyncValueAdd() 
is actually a function call.  There's a _XSyncValueAdd() macro (note the 
leading '_') in there that has the problem you describe.  According to 
the comment above the macros:

/*  The _XSync macros below are for library internal use only.  They exist
  *  so that if we have to make a fix, we can change it in this one place
  *  and have both the macro and function variants inherit the fix.
  */

So it seems you (and xfwm4) shouldn't be using those macros at all?

	-brian




More information about the Xfce4-dev mailing list