<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - False positive warnings with gcc's -Wundef"
href="https://bugs.freedesktop.org/show_bug.cgi?id=73193">73193</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>chris@chris-wilson.co.uk
</td>
</tr>
<tr>
<th>Summary</th>
<td>False positive warnings with gcc's -Wundef
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>cairo-bugs@cairographics.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>self@brendanlong.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>cairo
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=91377" name="attach_91377" title="Patch to set disabled feature macros to 0 instead of undefined">attachment 91377</a> <a href="attachment.cgi?id=91377&action=edit" title="Patch to set disabled feature macros to 0 instead of undefined">[details]</a></span>
Patch to set disabled feature macros to 0 instead of undefined
I'm trying to clean out gcc warnings in WebKitGTK, and running into this one:
In file included from
../../Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp:42:0:
/usr/include/cairo/cairo-gl.h:113:5: error: "CAIRO_HAS_WGL_FUNCTIONS" is not
defined [-Werror=undef]
#if CAIRO_HAS_WGL_FUNCTIONS
Theoretically, gcc shouldn't be complaining about this because Cairo is a
system library, but it does, and I can't figure out why (the -I lines are from
pkg-config so I can't easily fix them). The easiest solution seems to be to fix
this in Cairo.
The attached patch defines all undefined feature flags to 0. I tried to keep
the semantics exactly the same, and as similar as possible to the original
output, so if that's not necessarily I could simply if it more:
* The current version has lines like this:
/*#undef CAIRO_HAS_WGL_FUNCTIONS */
I assume this so users can `#define CAIRO_HAS_WGL_FUNCTIONS 1` and override
the default. To have the same semantics, I wrapped by definitions in `#ifndef`
checks.
* There's a fairly complex `for` loop to keep the disabled features list
sorted (since sorting the entire output would put the #defines first, then the
#endifs, then the #ifndefs..).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>