Bug 4379 - Make compilation with -Wshadow less noisy
Summary: Make compilation with -Wshadow less noisy
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.0.0
Hardware: x86 (IA32) Linux (All)
: high minor
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
: 7326 (view as bug list)
Depends on:
Reported: 2005-09-07 02:35 UTC by David Neèas
Modified: 2006-06-25 16:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

proposed patch (4.14 KB, patch)
2005-09-07 02:36 UTC, David Neèas
Details | Splinter Review

Description David Neèas 2005-09-07 02:35:28 UTC
cairo.h uses y0 and y1 (the names of standard math.h Bessel functions) as
function prototype argument names in several places, making gcc -Wshadow very
noisy and practically unusable for compilation of programs that use Cairo.  I'm
attaching a patch that fixes that.

It is in fact a gcc problem, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=529, but even though it's fixed no
version of gcc with the fix has been released yet.
Comment 1 David Neèas 2005-09-07 02:36:19 UTC
Created attachment 3190 [details] [review]
proposed patch
Comment 2 Behdad Esfahbod 2006-06-14 00:11:35 UTC
Fixing the headers is important, as they generate warnings for cairo users.  The
C files are not really important, and your patch for them doesn't look right to
me as it only changes docs, not the parameters.  I think we can just commit the
header changes, possibly update for any new API having y0 or y1 in the prototype.
Comment 3 David Neèas 2006-06-14 00:20:54 UTC
Header files have to be fixed as they generate the warnings.  gtk-doc
documentation has to match *header files*, not implementation.  If the patch
does this -- as it seems to me -- it is correct.  Of course, nothing prevents
one from changing the implementation too, it's a matter of taste how many
underscores one wants in the implementation.

A side note: since the release of gcc 4.1 which finally got it right patches
like this are becoming less relevant.
Comment 4 Carl Worth 2006-06-14 04:46:24 UTC
I'd prefer to just not uglify the cairo headers as a workaround for a gcc bug
that is now (finally) fixed.

Comment 5 Carl Worth 2006-06-25 16:20:00 UTC
*** Bug 7326 has been marked as a duplicate of this bug. ***

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.