Bug 7963 - cleanups for warnings from sparse/gcc
Summary: cleanups for warnings from sparse/gcc
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.2.4
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 01:24 UTC by Kjartan Maraas
Modified: 2008-10-01 11:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
cleanups (7.11 KB, patch)
2006-08-23 01:25 UTC, Kjartan Maraas
Details | Splinter Review
patch to remove unsused code (2.65 KB, patch)
2006-11-01 04:30 UTC, Kjartan Maraas
Details | Splinter Review
if vs ifdef changes (2.51 KB, patch)
2006-11-01 04:30 UTC, Kjartan Maraas
Details | Splinter Review

Description Kjartan Maraas 2006-08-23 01:24:44 UTC
Here's another batch of cleanups for cairo.
Comment 1 Kjartan Maraas 2006-08-23 01:25:10 UTC
Created attachment 6653 [details] [review]
cleanups
Comment 2 Carl Worth 2006-08-25 07:36:12 UTC
Kjartan,

In general the cleanups look good. Could you please separate this patch into
individual patches based on the class of issue being resolved? It looks like
there are about three separate things happening in the current patch.

Of course, each separate patch should also have its own description for the
commit message.

-Carl
 
Comment 3 Behdad Esfahbod 2006-08-25 07:52:07 UTC
Also check:

  http://lists.freedesktop.org/archives/cairo/2006-August/007626.html
Comment 4 Kjartan Maraas 2006-11-01 04:30:02 UTC
Created attachment 7617 [details] [review]
patch to remove unsused code
Comment 5 Kjartan Maraas 2006-11-01 04:30:47 UTC
Created attachment 7618 [details] [review]
if vs ifdef changes

looks like this overlaps with pavel's work, and that it's not wanted anyway.
putting it here for completeness
Comment 6 Kjartan Maraas 2007-01-11 09:48:22 UTC
Ping? I think these still apply.
Comment 7 Behdad Esfahbod 2007-01-11 15:02:01 UTC
Ok, committed the unused-code patch.

About the #if syntax one, I'm a bit hesitant, given the current mixed usage numbers:

[behdad@home src]$ grep '^#if\>' *.c | wc -l
63
[behdad@home src]$ grep '^#if\>' *.h | wc -l
39
[behdad@home src]$ grep '^#if[dn]' *.c | wc -l
49
[behdad@home src]$ grep '^#if[dn]' *.h | wc -l
69

Any reason to only change the ones you are doing in the patch?  How are they
different?
Comment 8 Chris Wilson 2008-10-01 09:15:13 UTC
The debate over '#if' vs '#ifdef' will flare up every now and again without any victors or pressing reason to change all the instances in the code. That said, the code is gradually become more consistent in its use of '#if'.

Cleanups from sparse and other static analysers are always desired. However with sparse we first need a method to increase the signal to noise, and then teach it how to handle the rules peculiar to cairo. So instead we're looking at other tools such as http://developer.mozilla.org/en/Treehydra which currently look more promising.

Closing as this bug as they are no more specific actions required. But don't let that stop you from continuing to test cairo and report as many warning as you find! (Patches preferred ;-)
Comment 9 Behdad Esfahbod 2008-10-01 11:31:32 UTC
I now have a test in src/ making sure that CAIRO_* conditionals are never used with ifdef.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.