Re: Multi-byte chars
In <beguk0$fu4$1@n ews.hananet.net > "Jun Woong" <mycoboco@hanma il.net> writes:
[color=blue]
>"Dan Pop" <Dan.Pop@cern.c h> wrote in message news:begm13$kq9 $1@sunnews.cern .ch...[color=green]
>> In <beg43f$se3$1@n ews.hananet.net > "Jun Woong" <mycoboco@hanma il.net> writes:[/color]
>[...][color=green][color=darkred]
>> >>
>> >> I have quoted the *relevant* wording. The library clause has no business
>> > ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
>> >> defining the semantics of wide characters, which are a language issue.
>> > ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
>> >[/color][/color]
>[...][color=green]
>>
>> The text you've underlined makes perfect sense to me (otherwise I
>> wouldn't have written in the first place).[/color]
>
>According to your logic, the following program is not s.c. even in[/color]
Don't invoke my logic, since you're obviously unable to undestand it.
[color=blue]
>C90, which is perfectly incorrect thought. Is this what you are
>saying?
>
> #include <stdio.h>
>
> int main(void)
> {
> if ('a' == L'a') puts("okay");
>
> return 0;
> }[/color]
Nope, what I'm saying is that C90 is broken by making this program
strictly conforming: what are the choices for wide characters of an
EBCDIC-based implementation? Remove the broken text from the library
clause and C90 becomes more sensible. Ditto about C99, which contains
the same text.
[color=blue][color=green][color=darkred]
>> >Some implementations of the standard
>> >library depended on that '%' == L'%' with the requirement of C90,
>> >and it was a reliable choice in practice *at that time*.[/color]
>>
>> The implementor can depend on *anything* he wants, because he has full
>> control over the implementation, he doesn't need any guarantees from the
>> standard about the relationship between normal characters and wide
>> characters because he knows *exactly* what this relationship is on that
>> particular implementation.[/color]
>
>The story changes if the implementer wants to make as many parts of
>his library conform to the standard as possible.[/color]
The standard contains no requirement that the standard library is
implemented in C in the first place. A library implementation conforms
to the standard if it follows the standard specification for the library,
no matter in what language it is written or how portable or non-portable
its code is. Ideally, all the parts of the library should conform to the
library specification, not only "as many parts as possible" ;-)
Assuming that you're talking about implementing the library in portable
C (which is definitely NOT what you wrote above), I fail to see how the
assumption 'a' == L'a' can make the code more portable.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de
In <beguk0$fu4$1@n ews.hananet.net > "Jun Woong" <mycoboco@hanma il.net> writes:
[color=blue]
>"Dan Pop" <Dan.Pop@cern.c h> wrote in message news:begm13$kq9 $1@sunnews.cern .ch...[color=green]
>> In <beg43f$se3$1@n ews.hananet.net > "Jun Woong" <mycoboco@hanma il.net> writes:[/color]
>[...][color=green][color=darkred]
>> >>
>> >> I have quoted the *relevant* wording. The library clause has no business
>> > ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
>> >> defining the semantics of wide characters, which are a language issue.
>> > ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
>> >[/color][/color]
>[...][color=green]
>>
>> The text you've underlined makes perfect sense to me (otherwise I
>> wouldn't have written in the first place).[/color]
>
>According to your logic, the following program is not s.c. even in[/color]
Don't invoke my logic, since you're obviously unable to undestand it.
[color=blue]
>C90, which is perfectly incorrect thought. Is this what you are
>saying?
>
> #include <stdio.h>
>
> int main(void)
> {
> if ('a' == L'a') puts("okay");
>
> return 0;
> }[/color]
Nope, what I'm saying is that C90 is broken by making this program
strictly conforming: what are the choices for wide characters of an
EBCDIC-based implementation? Remove the broken text from the library
clause and C90 becomes more sensible. Ditto about C99, which contains
the same text.
[color=blue][color=green][color=darkred]
>> >Some implementations of the standard
>> >library depended on that '%' == L'%' with the requirement of C90,
>> >and it was a reliable choice in practice *at that time*.[/color]
>>
>> The implementor can depend on *anything* he wants, because he has full
>> control over the implementation, he doesn't need any guarantees from the
>> standard about the relationship between normal characters and wide
>> characters because he knows *exactly* what this relationship is on that
>> particular implementation.[/color]
>
>The story changes if the implementer wants to make as many parts of
>his library conform to the standard as possible.[/color]
The standard contains no requirement that the standard library is
implemented in C in the first place. A library implementation conforms
to the standard if it follows the standard specification for the library,
no matter in what language it is written or how portable or non-portable
its code is. Ideally, all the parts of the library should conform to the
library specification, not only "as many parts as possible" ;-)
Assuming that you're talking about implementing the library in portable
C (which is definitely NOT what you wrote above), I fail to see how the
assumption 'a' == L'a' can make the code more portable.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de
Comment