public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* --enable-c-mbchar weirdness
@ 2002-08-27  7:19 Arkadiusz Miskiewicz
  2002-08-27  9:23 ` Zack Weinberg
  0 siblings, 1 reply; 3+ messages in thread
From: Arkadiusz Miskiewicz @ 2002-08-27  7:19 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2392 bytes --]

Hi,

[misiek@arm misiek]$ cat test.c
#include <stdio.h>

int main()
{
    printf("&eogon;ó&aogon;&sacute;&lstrok;&zdot;&zacute;&cacute;&nacute;&Eogon;Ó&Aogon;&Sacute;&Lstrok;&Zdot;&Zacute;&Cacute;&Nacute;\n");
    return 0;
}

(these are iso8859-2 characters)

[misiek@arm misiek]$ LC_ALL=C gcc -O2 test.c && ./a.out
test.c: In function `main':
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
test.c:5: warning: ignoring invalid multibyte character
&eogon;ó&aogon;&sacute;&lstrok;&zdot;&zacute;&cacute;&nacute;&Eogon;Ó&Aogon;&Sacute;&Lstrok;&Zdot;&Zacute;&Cacute;&Nacute;

warning for each character but result is ok

[misiek@arm misiek]$ LC_ALL=pl_PL gcc -O2 test.c && ./a.out
\x19ó\x05[B|z\aD\x18Ó\x04ZA{y\x06C

Is this how --enable-c-mbchar is supposed to work? Different
result of compilation depending on used locale? Strange...


Reading specs from /usr/lib/gcc-lib/athlon-pld-linux/3.2/specs
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-c-mbchar --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,f77,gcov,java,objc,ksi,ada --enable-c99 --enable-long-long --enable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x athlon-pld-linux
Thread model: posix
gcc version 3.2

glibc-2.2.5-15

-- 
Arkadiusz Mi&sacute;kiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: --enable-c-mbchar weirdness
  2002-08-27  7:19 --enable-c-mbchar weirdness Arkadiusz Miskiewicz
@ 2002-08-27  9:23 ` Zack Weinberg
  2002-08-27 10:38   ` Phil Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Zack Weinberg @ 2002-08-27  9:23 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: gcc

On Tue, Aug 27, 2002 at 04:18:00PM +0200, Arkadiusz Miskiewicz wrote:
> 
> Hi,
...

> Is this how --enable-c-mbchar is supposed to work? Different
> result of compilation depending on used locale? Strange...

Yes, unfortunately, we do not yet have a way for source files to
indicate their encoding.  Also, --enable-c-mbchar has gone unused for
a long time and is therefore likely to have bugs.  It appeared that
with LC_ALL set to pl_PL the string was mangled -- if so, could I
trouble you to investigate further and try to find out why?

zw

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: --enable-c-mbchar weirdness
  2002-08-27  9:23 ` Zack Weinberg
@ 2002-08-27 10:38   ` Phil Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Edwards @ 2002-08-27 10:38 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Arkadiusz Miskiewicz, gcc

On Tue, Aug 27, 2002 at 09:23:45AM -0700, Zack Weinberg wrote:
> On Tue, Aug 27, 2002 at 04:18:00PM +0200, Arkadiusz Miskiewicz wrote:
> > Is this how --enable-c-mbchar is supposed to work? Different
> > result of compilation depending on used locale? Strange...
> 
> Yes, unfortunately, we do not yet have a way for source files to
> indicate their encoding.  Also, --enable-c-mbchar has gone unused for
> a long time and is therefore likely to have bugs.

As an aside, both gcc and libstdc++-v3 pay attention to this option.  (Not
that this effects the OP's question, just FYI.)


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-27 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27  7:19 --enable-c-mbchar weirdness Arkadiusz Miskiewicz
2002-08-27  9:23 ` Zack Weinberg
2002-08-27 10:38   ` Phil Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).