Bug 4379

Summary: Make compilation with -Wshadow less noisy
Product: cairo Reporter: David Neèas <yeti>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED NOTOURBUG QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: minor    
Priority: high CC: erikd+cairo
Version: 1.0.0   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch

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.

-Carl
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.