| Summary: | g++ < 4.3 doesn't compile unistd.h with -O2 -pedantic | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | Ivan A. Melnikov <iv> |
| Component: | glibc-devel | Assignee: | Gleb F-Malinovskiy <glebfm> |
| Status: | CLOSED WONTFIX | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P3 | CC: | glebfm, ldv |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
Не знаю, на что более корректно это повесить, наверное, на glibc-devel. В g++ >= 4.3 это работает, а фиксить поддержку -O2 -pedantic в старых компиляторах -- это маловероятно. см. тж. http://sourceware.org/bugzilla/show_bug.cgi?id=14530 и http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b7bfe116e6304da848759b69a6d713da3e93e936 g++ < 4.3 is irrelevant. |
Простой пример: $ cat a.cpp #include <unistd.h> int main() { return 0; } $ g++-4.1 -O2 -pedantic a.cpp /usr/include/bits/unistd.h: In function ‘int gethostname(char*, size_t)’: /usr/include/bits/unistd.h:344: error: declaration of ‘int gethostname(char*, size_t) throw ()’ throws different exceptions /usr/include/unistd.h:901: error: from previous declaration ‘int gethostname(char*, size_t)’ /usr/include/bits/unistd.h: In function ‘int getdomainname(char*, size_t)’: /usr/include/bits/unistd.h:373: error: declaration of ‘int getdomainname(char*, size_t) throw ()’ throws different exceptions /usr/include/unistd.h:920: error: from previous declaration ‘int getdomainname(char*, size_t)’ Если убрать -O2 или -pedantic -- работает. Обнаружил при попытке разобраться, что же случилось с libncursesxx: http://lists.altlinux.org/pipermail/devel/2012-October/195599.html $ rpm -qf /usr/include/unistd.h glibc-devel-2.16-alt4 $ rpm -qf `which g++-4.1` gcc4.1-c++-4.1.2-alt11