This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/25025] Failure to build, <command line>:1:2: error: missing '(' after predicate



------- Comment #7 from pda at freeshell dot org  2005-12-04 00:06 -------
Subject: Re:  Failure to build, <command line>:1:2: error: missing '(' after
predicate

On Tue, Nov 29, 2005 at 10:00:39PM -0000, dave at hiauly1 dot hia dot nrc dot
ca wrote:
> 
> ------- Comment #6 from dave at hiauly1 dot hia dot nrc dot ca  2005-11-29 22:00 -------
> Subject: Re:  Failure to build, <command line>:1:2: error: missing '(' after
> predicate
> 
> > On Sun, Nov 27, 2005 at 06:57:05PM -0000, danglin at gcc dot gnu dot org wrote:
> > > The "-Aa" option is likely the problem.  It's probably set in
> > > CFLAGS.  If you're using the HP tools, put the "-Aa" in your CC
> > > define.  There's more info in the manual on this.
> > 
> > No, I never put "-Aa" in CFLAGS, it's being added inside the gcc build
> > itself.  I tried your suggestion of adding "-Aa" to CC, but my build
> > fails much earlier in that case, due to not finding a definition of
> > "struct stat".  Do you care to know more about that?
> 
> Ok, this is comming from the configure test "checking for $CC option to
> accept ANSI C".  This option shouldn't be used for the libstdc++ build
> but obviously it is...

Thanks for your help, it turns out you were almost right the first time.
Although I wasn't setting CFLAGS, I unwittingly had "-Aa" in my CXXFLAGS.
Stopping that solved my problem.

> In order to build GCC 3.4 and later, you need an ANSI compiler.  You
> also need to include the full HP-UX namespace   The  "struct stat" error
> probably is a result of not providing the appropriate namespace defines
> in you CC define.  -Aa provides strict ANSI.  For example, these are
> the defines that I use for GCC builds prior to 4.0 under HP-UX 11.11:
> 
> -D_HPUX_SOURCE -D_XOPEN_UNIX -D_XOPEN_SOURCE_EXTENDED
> -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE_XOPEN_SOURCE_500
> 
> -D_HPUX_SOURCE is the important define.  The others are needed for C++
> library support (wide characters, etc).

I've mostly always used HP's ANSI compiler in the default -Ae mode,
which includes -D_HPUX_SOURCE, however I discovered it also add +e,
which allows `long long'.  All 3.4 and 4.0 gcc's I tried had `long
long' variables that required this.  I found this odd, given that I
was building 64-bit code.  I'd say this is a bug -- would you agree?

> Instead of trying to build C++ starting with an HP compiler, it's easier
> to just build C and then use this compiler to rebuild GCC with the additional
> languages that you want.  It's always been tricky to bootstrap GCC using
> an HP compiler and its not tested much.  You should use binutils (current
> CVS version is needed with GCC 4.1 and later for EH exception support).

I can appreciate that, and was almost about to resort to C only, but
my C++ is good now.  Is binutils-2.16.1 fine for 4.0?  I'll run the
tests and find out for myself anyway.

Thanks again.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25025


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]