This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.7.2.3 says «Unterminated string» in inline function containing terminated string with letters above 127d
- To: bug-gcc <bug-gcc at gnu dot org>
- Subject: g++ 2.7.2.3 says «Unterminated string» in inline function containing terminated string with letters above 127d
- From: Trond Endrestøl <trond at ramstind dot gtf dot ol dot no>
- Date: Sun, 26 Mar 2000 20:35:12 +0200 (CEST)
Hi,
Although I know gcc 2.7.2.3 isn't the latest release, I'd like you to
try out on the latest release and perhaps on the current development
version the following code:
#include <iostream.h>
class c {
public:
void f()
{
cout << "Some text containing the letter å";
}
};
I'm running FreeBSD 3.4 and this is how I compiled the code above:
gcc -Wall -c myprog.cc
gcc gives the following output on stderr:
myprog.cc: In method `void c::f()':
myprog.cc:7: Unterminated string
myprog.cc:9: parse error at end of input
If I remove the letter `å', then the code compiles as expected. When I
tried with other (special Norwegian) letters such as æ and ø, I got
the same result. Even the uppercase versions (Æ Ø Å) gave the same
results. The string could simply consist of an å to reproduce the bug.
When I moved the inline function outside of the class, I got no
diagnostic on stderr. I suppose the C++ compiler isn't totally 8 bit
clean and that the bug can be reproduced with a string containing any
character with the high bit set.
Anyway, you'll find attached as myprog.ii.gz, the gzipped preprocessed
output produced with the command:
gcc -save-temps -Wall -c myprog.cc
I can not (yet) upgrade to the current release, but I hope the bug is
not present in the current release.
TIA,
Trond Endrestol.
----------------------------------------------------------------------
Trond Endrestøl | trond@gtf.ol.no
Merkantilvegen 59HB7, | trond@ramstind.gtf.ol.no
N-2815 GJØVIK, NORWAY |+47 61139424 || +47 63874242
Patron of The Art of Computer Programming| FreeBSD 3.4 & Pine 4.21
gzipped preprocessed output