Article View: gnu.g++.lib.bug
Article #271Re: libg++-2.2 using HP's CC
From: bothner
Date: Wed, 19 Aug 1992 15:14
Date: Wed, 19 Aug 1992 15:14
68 lines
3033 bytes
3033 bytes
Thank you for your report. Of course, our primary goal is to
support g++, but I accept changes reduce dependencies on g++-specific
features or extensions. However, changes to work around bugs
in a specific vendor's C++ compiler are less likely to get accepted.
> o HP CC doesnt support or >? or <? operators.
> I worked around this by either conditionally compiling for __GNUG__
> or removing the code altogether.
Seems to have already been fixed.
> o HP CC doesn't inline as many constructs as g++, especially inlines with
> return statements followed by other code
I'm not going to change these. However, I'll consider "simplifications".
I.e. if 'return A ? B : C' is preferable to 'if (A) return B; else return C;'
I'm willing to re-write to use the former form.
> o HP CC doesn't allow the same default arguments to be speficied more than
> once,
I fixed these, since here HP CC follows the ARM.
> o HP CC doesn't allow scoped typedefs with a class (e.g. ios::fmtflags)
These changes I ignored. HP CC is boggy/obsolete in this respect.
o HP CC can't statically initialise classes - you have to make them into
> structs !
> I conditionally compiled around this with HPCC_NO_CLASS_INIT
This was no longer applicable.
> o HP CC only allows the keyword virtual to appear in a class declaration
Fixed this.
> o You need HP CC specific code to initialise vtables in strstrbufs.cc
> I conditionally compiled around this with HPCC_VTBL_DECLARATION
Why doesn't the generic cront version work? Is __vtbl__7filebuf
the wrong type? If so, what?
> o HP CC get's confused by externally declared functions followed by their
> [inline] implementations
No longer applicable.
> o HP CC doesn't support implicit casts from void * via assignment:
> char *s = malloc(2); // doesn't work
> char *s = (char*)malloc(2); // does
I think these have been fixed (as gcc is more finicky now).
> similarly
> char *s = NULL; // doesn't NULL is void * 0
> char *s = (char*)NULL; // does
These I don't want to change. If your compiler does not recognize
(void*)0 as a NULL pointer, redefine NULL as 0 instead.
The g++-include changes I don't think I want to bother with.
I'm more include to suggest using Ron Guilmette's pupulate script,
which generates include stub files (with extern "C" { #include_next <XX.h> })
for system include file.
--Per Bothner
Cygnus Support bothner@cygnus.com
Technical Details
Message-ID:
<9208200514.AA23599@rtl.cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!cygnus.com!bothnerReferences:
<9208191616.AA29986@burgess.ansa.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!cygnus.com!bothner From: bothner@cygnus.com Subject: Re: libg++-2.2 using HP's CC Message-ID: <9208200514.AA23599@rtl.cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <9208191616.AA29986@burgess.ansa.co.uk> Distribution: gnu Date: Wed, 19 Aug 1992 15:14:18 GMT Approved: bug-lib-g++@prep.ai.mit.edu Lines: 69