This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14509] New: Problem compiling ACE (sigaction)
- From: "schmid at snake dot iap dot physik dot tu-darmstadt dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2004 05:49:55 -0000
- Subject: [Bug c++/14509] New: Problem compiling ACE (sigaction)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following example reduced from the current ACE distribution does not
compile. Gcc 3.3 accepts it without a warning. When I change the #if 1 to #if 0
the code is accepted. Maybe I am mistaken but this result is surprising to me
and it might be a regression. Please explain that ACE can be fixed
appropriately.
g++ -v -c t.C
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c
++,f77,objc --enable-__cxa_atexit --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.0 20040309 (prerelease)
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -quiet -v -D_GNU_SOURCE
t.C -quiet -dumpbase t.C -mtune=pentiumpro -auxbase t -version -o /tmp/
ccsHlEoU.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/
i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/
i686-pc-linux-gnu
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/
backward
/usr/local/include
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include
/usr/include
End of search list.
GNU C++ version 3.4.0 20040309 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 3.4.0 20040309 (prerelease).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64274
t.C:18: error: `int ACE_OS::sigaction(int, const sigaction*, sigaction*)'
should have been declared inside `ACE_OS'
t.C: In function `int ACE_OS::sigaction(int, const sigaction*, sigaction*)':
t.C:19: error: invalid const_cast from type `const sigaction*' to type
`sigaction*'
source code t.C
struct sigaction {};
extern int sigaction (int __sig, __const struct sigaction * __act,
struct sigaction * __oact) throw ();
namespace ACE_OS
{
extern int sigaction (int signum,
const struct sigaction *nsa,
struct sigaction *osa);
}
#if 1
int ACE_OS::sigaction (int signum,
const struct sigaction *nsa,
struct sigaction *osa)
{
return ::sigaction (signum, const_cast<struct sigaction*> (nsa), osa);
}
#else
int ACE_OS::sigaction (int signum,
const struct ::sigaction *nsa,
struct ::sigaction *osa)
{
return ::sigaction (signum, const_cast<struct ::sigaction*> (nsa), osa);
}
#endif
--
Summary: Problem compiling ACE (sigaction)
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schmid at snake dot iap dot physik dot tu-darmstadt dot
de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14509