Opened 12 years ago
Closed 12 years ago
#8882 closed bug (fixed)
add gcc version check to gl.h to avoid warnings
Reported by: | jstressman | Owned by: | kallisti5 |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta1 |
Component: | Kits/OpenGL Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Currently (hrev44524) when building things like SDL, we get thousands of warning messages about "warning: `visibility' attribute directive ignored"
A version check to not use this attribute unless we have a higher GCC version avoids this.
The attached patch fixes the problem for me, but I'd like for someone more knowledgeable to have a look. :)
Attachments (1)
Change History (9)
comment:1 by , 12 years ago
patch: | 0 → 1 |
---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
I've also added a check for ELF since I believe it only makes sense in that context.
I can't seem to find a clear note on exactly when the visibility attribute was added, but I see a number of discussions stating it as >= GCC 3.3 (I accidentally made it >= 3.2 instead of just > 3.2)
There is a discussion about it on the zlib mailing list for instance: http://mail.madler.net/pipermail/zlib-devel_madler.net/2012-February/002773.html
Updated the patch with these 2 changes.
by , 12 years ago
comment:4 by , 12 years ago
If it matters, Mesa 7.11.2 already has a check added.
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
and our line is currently as follows:
#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
So you could say it's already been upstreamed. I guess I just took a more complicated/specific route?
comment:5 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 12 years ago
I commited an adjusted mesa 7.8.2 diff and a new bep to the ports site (hrev2276)... i still need to test it though before considering this resolved.
comment:7 by , 12 years ago
should be solved in hrev45296.. but i need to start removing the "--f-no-warnings" stuff to have final verification.
comment:8 by , 12 years ago
Milestone: | R1 → R1/beta1 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
resolved in hrev45297
The patch looks fine (did you check the actual verson when the attribute was introduced in gcc ?)
Since this is an OpenGL header, it now lives in an optional package however. We may either want to patch it in our port or upstream the change to Mesa (if it's not already done there).