Bug 485619
Summary: | too few arguments to function 'int __gthrw_pthread_detach(pthread_t) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Ralf Corsepius <rc040203> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | rawhide | CC: | jakub |
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: | 2009-02-17 12:40:25 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: | |||
Bug Depends On: | |||
Bug Blocks: | 485633 |
Description
Ralf Corsepius
2009-02-15 12:49:08 UTC
This bug is caused by gcc/g++ using unsafe symbols in its gthr-* headers. In this particular case, an application's define overrides symbols from gthr*. The bug can easily be reproduced by compiling this code fragment: # cat foo.cc #define thread #include <string> # g++ -Wall -o foo foo.cc In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr.h:165, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/ext/atomicity.h:39, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/bits/basic_string.h:46, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/string:58, from foo.cc:2: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_create(__gthread_t*, void* (*)(void*), void*)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:681: error: expected primary-expression before ‘,’ token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_join(__gthread_t, void**)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:687: error: expected primary-expression before ‘,’ token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_detach(__gthread_t)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:129: error: too few arguments to function ‘int __gthrw_pthread_detach(pthread_t)’ /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:693: error: at this point in file That testcase is invalid, see [lib.using.headers]/3: "A translation unit shall include a header only outside of any external declaration or definition, and shall include the header lexically before the first reference to any of the entities it declares or first defines in that translation unit." That said, I'll uglify the function arguments in gthr*.h soon. (In reply to comment #2) > That testcase is invalid, see [lib.using.headers]/3: > "A translation unit shall include a header only outside of any external > declaration or definition, and shall include the header lexically before the > first reference to any of the entities it declares or first defines in that > translation unit." Errm, ... a card blanche to justify any symbol clash with libstdc++? "In case of symbol clashes libstdc++ is always right"? Pardon, but this looks like a serious defect of the standards to me. See http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00716.html Note also the list of other headers that have non-uglified function parameters or or inline fn local variables. |