Bug 381411
| Summary: | Odd g++ warning from pthread.h when compiling with -fno-exceptions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Josh Boyer <jwboyer> | ||||
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 8 | ||||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2007-11-21 08:53:01 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Josh Boyer
2007-11-14 02:29:42 UTC
Created attachment 257601 [details]
small test app to try compiling
Compiling this test app shows the warning when passing -fno-exceptions. (Yes,
I know the application is stupid and broken. It's only to illustrate the
warning that I can't figure out.)
[jwboyer@vader ~]$ g++ -O2 -Wall test.C -o foo -lpthread
[jwboyer@vader ~]$ g++ -O2 -Wall -fno-exceptions test.C -o foo -lpthread
test.C: In member function ‘void foo::push(uint32_t)’:
test.C:22: warning: type-punning to incomplete type might break strict-aliasing
rules
test.C: In member function ‘void foo::pop(uint32_t&)’:
test.C:28: warning: type-punning to incomplete type might break strict-aliasing
rules
[jwboyer@vader ~]$
Ok, I can't figure out what the compiler is warning about. I even tried using -dD -E to get preprocessed output and that didn't lead me to any further conclusions. I'm not sure if this is a g++ bogus warning, or if something is truly broken here. This seems to happen on all of the more recent distros I've tried. Perhaps an upstream bug should be opened? If so, should it be done against GCC or glibc? If you use cancellation, then it is terribly bad idea to compile with -fno-exceptions. That said, I have added an extra void * cast to shut up the warnings with g++ 4.1/4.2, g++ 4.3 is smart enough not to warn in this case. (In reply to comment #4) > If you use cancellation, then it is terribly bad idea to compile with > -fno-exceptions. That said, I have added an extra void * cast to shut up the > warnings with g++ 4.1/4.2, g++ 4.3 is smart enough not to warn in this case. Thanks Jakub. |