[Xfce4-commits] r29924 - in xfce4-dev-tools/trunk: . m4macros
Ali Abdallah
aliov at xfce.org
Mon May 4 23:56:58 CEST 2009
Brian J. Tarricone wrote:
> 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?
I really like what xdt-features has now, so i vote for keeping it like
that, i'm not sure if there is a compiler attribute to don't warn of
specific statement or a function call?
>
> 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?
I was wrong, what we are using here is XSync functions, but it is just
#define XSync _XSync in the sync header, and these functions are used
everywhere (xfwm4, gpm, metacity, lot of other wm), i'm quite surprised
that i didn't find on the net any complains about it.
>
> -brian
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
More information about the Xfce4-dev
mailing list