g++ 2.7.2.3 says «Unterminated string» in inline function containing terminated string with letters above 127d

Trond Endrestøl trond@ramstind.gtf.ol.no
Sun Mar 26 10:35:00 GMT 2000


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myprog.ii.gz
Type: application/x-gzip
Size: 5121 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000326/4ba63008/attachment.bin>


More information about the Gcc-bugs mailing list