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]

g++ bug in version 2.95.2



Bug Report for g++ 2.95.2
-------------------------
The following transcript shows a compilation error of a 
simple program under HPUX10.2 for g++ version 2.95.2.  It
compiles cleanly under SunOS 5.5.1 using the same version
of g++ (2.95.2).  Note: compiling under g++ 2.8.1 gives
the same error for HPUX10.2 and correctly compiles on
Solaris.




tu422:~/bin> uname -a
HP-UX tu422 B.10.20 A 9000/782 2012917803 two-user license

tu422:~/bin> g++ -v
Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)

tu422:~/bin> cat hello.cpp
// hello.cpp
#include <iostream.h>
#include <cstdlib>
using namespace std;

int main()
{
    cout << "Hello" << endl;
}

tu422:~/bin> g++ hello.cpp
In file included from /usr/include/sys/resource.h:24,
                 from /usr/include/sys/wait.h:83,
                 from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/includ
e/stdlib.h:231,
                 from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../
../../include/g++-3/cstdlib:6,
                 from hello.cpp:3:
/usr/include/sys/time.h:337: `extern' can only be specified for objects and 
functions





The statement that it's flagging the error on (line 337 of 
/usr/include/sys/time.h) is shown below

extern struct sigevent;

This looks like a bad extern statement to me since there is no
variable name, just the structure tag.

Is this a bug with gcc or the include files for HPUX?  Is something
funny going on in the preprocessor?  I'm curious
as to why there seems to be very little information about this 
error (in bug reports, in the FAQ, etc) even though it seems like
it's been around for a bit and must have been seen elsewhere?

Am I using the standard C++ notation wrong?  Should I be using
the libstdc++-2.90.8 module.  If so, why does it compile on Solaris
but not HPUX?  Is that just a coincidence?  It seems like I must be
doing something wrong but I can't find out where.


Tim Morse

-- 
Tim Morse		 | "What I don't want to see is the Bills
tmorset@tus.ssi1.com	 |  winning the  Superbowl.  As  long  as
SSi/SPG/Ti		 |  I'm alive, that doesn't happen!" 
(714) 573-6321		 |                             CSM



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