Re: gcc-3.2.1 and c++ headers
Your working example below compiles without error using gcc 2.95.x (FreeBSD 4.x) and gcc 3.2.x (FreeBSD 5.x), which is expected since it's compliant C++. (See Stroustrup's The C++ Programming Language, section 9.2.2, which indicates that the proper way to include C++ standard library headers such as iostream, string, etc. is using angle brackets and no dot-h.) Be glad that the gcc maintainers have finally updated their C++ compiler to be more standards-compliant. I'd suggest feeding back patches to the jdk maintainer. -- Matt Emmerton - Original Message - From: Brent Verner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 08, 2003 1:17 PM Subject: gcc-3.2.1 and c++ headers In trying to compile the most recent native jdk-1.4.1, I noticed that compiling with the iostream.h header didn't work. // ** won't link ** #include iostream.h // ** works ** // #include backward/iostream.h // ** works ** // #include iostream // using namespace std; int main(){ return 1; } void xxx (ostream os) { os ' '; os out\n; } This code will compile on 4.7-stable (gcc-2.95), and on debian/linux (gcc-3.2.2) with a #warning. I am aware that the $HEADER.h includes are deprecated, but is there any intent to allow the deprecated headers to work with the system compiler (gcc-3.2.1), or should any affected apps be considered broken (on 5.0-current)? thanks. brent -- Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing. -- Duane Allman To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: gcc-3.2.1 and c++ headers
[2003-02-08 15:56] Matthew Emmerton said: | Your working example below compiles without error using gcc 2.95.x (FreeBSD | 4.x) and gcc 3.2.x (FreeBSD 5.x), which is expected since it's compliant | C++. (See Stroustrup's The C++ Programming Language, section 9.2.2, which | indicates that the proper way to include C++ standard library headers such | as iostream, string, etc. is using angle brackets and no dot-h.) You compiled it on a -current (gcc-3.2.1) system? It does will not compile on mine, current as of 6 Feb. I noticed the problem with -current from 2 Feb, so I can't comment on anything before that date. brent@scratch$ cat test.cc #include iostream.h int main(){ return 1; } void xxx (ostream os) { os ' '; os out\n; } brent@scratch$ g++ test.cc -o test /var/tmp//ccuRnfCI.o: In function `xxx(ostream)': /var/tmp//ccuRnfCI.o(.text+0x27): undefined reference to `ostream::operator(char)' /var/tmp//ccuRnfCI.o(.text+0x3a): undefined reference to `ostream::operator(char const*)' brent@scratch$ uname -a FreeBSD scratch.rcfile.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Feb 6 13:39:46 EST 2003 [EMAIL PROTECTED]:/jail/.usr.obj/jail/.cvsup/src/sys/SCRATCH i386 brent@scratch$ g++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.2.1 [FreeBSD] 20021119 (release) | Be glad that the gcc maintainers have finally updated their C++ compiler to | be more standards-compliant. agreed :-) | I'd suggest feeding back patches to the jdk maintainer. the jdk code uses the iostream.h header, and will not compile on my system w/o some tweaks. cheers. brent -- Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing. -- Duane Allman To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: gcc-3.2.1 and c++ headers
It compiled on -CURRENT and -STABLE using this: #include iostream You've got #include iostream.h in your example below. Matt - Original Message - From: Brent Verner [EMAIL PROTECTED] To: Matthew Emmerton [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, February 08, 2003 4:15 PM Subject: Re: gcc-3.2.1 and c++ headers [2003-02-08 15:56] Matthew Emmerton said: | Your working example below compiles without error using gcc 2.95.x (FreeBSD | 4.x) and gcc 3.2.x (FreeBSD 5.x), which is expected since it's compliant | C++. (See Stroustrup's The C++ Programming Language, section 9.2.2, which | indicates that the proper way to include C++ standard library headers such | as iostream, string, etc. is using angle brackets and no dot-h.) You compiled it on a -current (gcc-3.2.1) system? It does will not compile on mine, current as of 6 Feb. I noticed the problem with -current from 2 Feb, so I can't comment on anything before that date. brent@scratch$ cat test.cc #include iostream.h int main(){ return 1; } void xxx (ostream os) { os ' '; os out\n; } brent@scratch$ g++ test.cc -o test /var/tmp//ccuRnfCI.o: In function `xxx(ostream)': /var/tmp//ccuRnfCI.o(.text+0x27): undefined reference to `ostream::operator(char)' /var/tmp//ccuRnfCI.o(.text+0x3a): undefined reference to `ostream::operator(char const*)' brent@scratch$ uname -a FreeBSD scratch.rcfile.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Feb 6 13:39:46 EST 2003 [EMAIL PROTECTED]:/jail/.usr.obj/jail/.cvsup/src/sys/SCRATCH i386 brent@scratch$ g++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.2.1 [FreeBSD] 20021119 (release) | Be glad that the gcc maintainers have finally updated their C++ compiler to | be more standards-compliant. agreed :-) | I'd suggest feeding back patches to the jdk maintainer. the jdk code uses the iostream.h header, and will not compile on my system w/o some tweaks. cheers. brent -- Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing. -- Duane Allman To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: gcc-3.2.1 and c++ headers
Specifically, this is the exact code that compiles error/warning free on gcc 2.95.4 (4-STABLE) and gcc 3.2.1 (5.0-REL) // begin code #include iostream using namespace std; void xxx (ostream os); int main(void) { xxx(cout); } void xxx (ostream os) { os ''; os out\n; } // end code - Original Message - From: Matthew Emmerton [EMAIL PROTECTED] To: Brent Verner [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, February 08, 2003 4:19 PM Subject: Re: gcc-3.2.1 and c++ headers It compiled on -CURRENT and -STABLE using this: #include iostream You've got #include iostream.h in your example below. Matt - Original Message - From: Brent Verner [EMAIL PROTECTED] To: Matthew Emmerton [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, February 08, 2003 4:15 PM Subject: Re: gcc-3.2.1 and c++ headers [2003-02-08 15:56] Matthew Emmerton said: | Your working example below compiles without error using gcc 2.95.x (FreeBSD | 4.x) and gcc 3.2.x (FreeBSD 5.x), which is expected since it's compliant | C++. (See Stroustrup's The C++ Programming Language, section 9.2.2, which | indicates that the proper way to include C++ standard library headers such | as iostream, string, etc. is using angle brackets and no dot-h.) You compiled it on a -current (gcc-3.2.1) system? It does will not compile on mine, current as of 6 Feb. I noticed the problem with -current from 2 Feb, so I can't comment on anything before that date. brent@scratch$ cat test.cc #include iostream.h int main(){ return 1; } void xxx (ostream os) { os ' '; os out\n; } brent@scratch$ g++ test.cc -o test /var/tmp//ccuRnfCI.o: In function `xxx(ostream)': /var/tmp//ccuRnfCI.o(.text+0x27): undefined reference to `ostream::operator(char)' /var/tmp//ccuRnfCI.o(.text+0x3a): undefined reference to `ostream::operator(char const*)' brent@scratch$ uname -a FreeBSD scratch.rcfile.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Feb 6 13:39:46 EST 2003 [EMAIL PROTECTED]:/jail/.usr.obj/jail/.cvsup/src/sys/SCRATCH i386 brent@scratch$ g++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.2.1 [FreeBSD] 20021119 (release) | Be glad that the gcc maintainers have finally updated their C++ compiler to | be more standards-compliant. agreed :-) | I'd suggest feeding back patches to the jdk maintainer. the jdk code uses the iostream.h header, and will not compile on my system w/o some tweaks. cheers. brent -- Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing. -- Duane Allman To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: gcc-3.2.1 and c++ headers
[2003-02-08 16:19] Matthew Emmerton said: | It compiled on -CURRENT and -STABLE using this: | | #include iostream | | You've got #include iostream.h in your example below. Deleting /usr/include/g++ and making installworld, fixes my problem. The compiler now gives the expected behavior; it compiles the code with a warning. sorry for the noise. grumble Why doesn't installworld clean up old headers? /grumble brent -- Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing. -- Duane Allman To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: gcc-3.2.1 and c++ headers
On Sat, Feb 08, 2003 at 04:55:07PM -0500, Brent Verner wrote: [2003-02-08 16:19] Matthew Emmerton said: | It compiled on -CURRENT and -STABLE using this: | | #include iostream | | You've got #include iostream.h in your example below. Deleting /usr/include/g++ and making installworld, fixes my problem. The compiler now gives the expected behavior; it compiles the code with a warning. sorry for the noise. grumble Why doesn't installworld clean up old headers? /grumble Why can't people read /src/UPDATING? -- Steve To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message