http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46333
Summary: problems with configure -enable-build-with-cxx
-disable-bootstrap
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: [email protected]
ReportedBy: [email protected]
Hi..so, I'm using configure -enable-build-with-cxx, with 4.5.1.
One person's machine has g++ 3.3.
Another's g++ produces executables that don't run, can't find libstdc++.
So autoconf decides sizeof(int) == 0.
On that machine, I'm instead trying /usr/bin/CC which is SunStudio 12.
Here are some of the problem.
I'm going to try to patch them all, but I don't have FSF papers.
g++ 3.3 doesn't like ATTRIBUTE_UNUSED after parameters,
as ansidecl.h says. But ARG_UNUSED isn't used much.
So:
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
identifier name. ATTRIBUTE_UNUSED is frequently used instead of
ARG_UNUSED. */
#ifndef ATTRIBUTE_UNUSED
#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#else
#define ATTRIBUTE_UNUSED /* nothing */
#endif
#endif
#define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
ENUM_BITFIELD mixes integers and enums.
Fix:
#if (GCC_VERSION > 2000)
#define ENUM_BITFIELD(TYPE, NAME, SIZE) __extension__ enum TYPE NAME : SIZE
#elif defined(__cplusplus)
#define ENUM_BITFIELD(TYPE, NAME, SIZE) enum TYPE NAME
#else
#define ENUM_BITFIELD(TYPE, NAME, SIZE) unsigned int
#endif
(in two copies of system.h)
but that breaks gengtype!
So I put in:
"ENUM_BITFIELD"{WS}?"("{WS}?{ID}{WS}?,{WS}?{ID}{WS}?,{WS}?[_0-9A-Z]+{WS}?");" {
/* do nothing */
}
not sure that is right!
some problem with obstack_free, I didn't investigate.
Maybe substraction involving void* NULL or 0?
Fix, obstack.h before:
Before:
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
After, add cast to char*:
# define obstack_free(h,obj) \
( (h)->temp = (char *) ((char*)(obj)) - (char *) (h)->chunk, \
ambiguity passing WIDE_INT to abs.
fix:
in hwint.h define wide_abs to labs, llabs, or _abs64
and use wide_abs
There are also problems then compiling gmp in tree.
I had to remove its #include <iosfwd> on Solaris because
that pulled in locale and there was some problem.
Maybe due to local hacks? I removed all the locale stuff from my gcc/gmp.
gmp also had using std::FILE which failed, I removed it.
oh, and I'm using a bit of C++.
gengtype doesn't like typedef vector<int> foo_t or destructors.
I worked around like so:
#include <vector>
using namespace std;
#define typedef_vector typedef vector /* hack for gengtype */
and then typedef_vector<int> foo_t;
and
#define DESTRUCTOR ~ /* hack for gengtype */
struct bar_t
{
bar_t() { }
virtual DESTRUCTOR bar_t() { }