[PULL] button mapping fix and unconstify patches

Keith Packard keithp at keithp.com
Tue Feb 11 19:47:47 PST 2014


Gaetan Nadon <memsize at videotron.ca> writes:

> On 14-02-11 12:08 AM, Keith Packard wrote:
>> It's not just the GCC version, unfortunately. I have a pile of versions,
>> and cannot generate any of the (useful) warnings that you have managed
>> to elicit from the compiler.
> I tried Ubuntu 13-10 with gcc 4.8.2.  The 32-bit version
>
>   35 -Wunused-result

Oh, right, I remember this from fontconfig -- ubuntu sets
_FORTIFY_SOURCE by default. I'd love to use this in the X server by
default, but I'm concerned that we'll end up breaking builds on ubuntu
if we unilaterally define it. Can you see what your build does with

        $ make CC="gcc -D_FORTIFY_SOURCE=2"

if it works, then we'd be find setting it for all gcc builds, otherwise
we'll need magic.

On my machine, I'm now getting 37 warnings (I'm also building kdrive
which has two warnings).

Yay! I can fix these easily now.

>    0 -Wpointer-arith    (as expected)
>    0 -Wformat		(you have 1)

I'm only a -Wformat issue in 64-bits, but 32-bits because (sizeof (int) == sizeof (long))

>    1 -Wunused-function
>
> On the 64 bit with gcc 4.6.3:
>
>   35 -Wunused-result
>    2 -Wpointer-arith
>    2 -Wformat
>    1 -Wunused-function

Sounds like you're a lot closer on 13-10 than 12-10. That's good news!

Here's a patch which cleans up all of the -Wunused-result warnings I'm
getting with -D_FORTIFY_SOURCE=2. I haven't tried running this server...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Clean-up-warnings-from-D_FORTIFY_SOURCE-2.patch
Type: text/x-diff
Size: 7177 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140211/4e56a94f/attachment.patch>
-------------- next part --------------

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140211/4e56a94f/attachment.pgp>


More information about the xorg-devel mailing list