Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Prototype designs always work. -- Don Vonada


devel / comp.lang.c / Re: Is this safe?

SubjectAuthor
* Re: Is this safe?James Kuyper
`* Re: Is this safe?Richard Damon
 +- Re: Is this safe?James Kuyper
 `- Re: Is this safe?Tim Rentsch

1
Re: Is this safe?

<tt85k9$1tj6h$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24783&group=comp.lang.c++#24783

  copy link   Newsgroups: comp.lang.c
 by: James Kuyper - Thu, 23 Feb 2023 16:52 UTC

On 2/23/23 11:24, Paavo Helde wrote:
> 23.02.2023 18:00 Muttley@dastardlyhq.com kirjutas:
>
>>
>> Unlike letters the characters for digits don't change unless you're
>> talking
>> about something like ancient egyptian.
>
> You are funny!
>
> I was bored, so I coded a counter-example:
>
> #include <locale.h>
> #include <ctype.h>
> #include <string>
> #include <iostream>
>
> int main() {
> if (!setlocale(LC_ALL, "French_Canada.1252")) {
> std::cerr << "Failed to set locale\n";
> return EXIT_FAILURE;
> }
> std::string s = "a² + b² = c²";
> bool result = isdigit(static_cast<unsigned char>(s[1]));
> std::cout << "'" << s[1] << "' is " <<
> (result? "a digit": "not a digit") << "\n";
> }
>
> Output:
>
> '²' is a digit

That's non-conforming.
"The isdigit function tests for any decimal-digit character (as defined
in 5.2.1)." (7.4.1.5).

"...
the 10 decimal digits
0 1 2 3 4 5 6 7 8 9" (5.2.1p3)

"digits" is italicized, an ISO convention indicating that this
constitutes the official definition of that term. '2' is on that list,
'²' is not, and that definition allows for only 10 digits.

Re: Is this safe?

<UcNJL.102163$eRZ7.2491@fx06.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24784&group=comp.lang.c++#24784

  copy link   Newsgroups: comp.lang.c
 by: Richard Damon - Thu, 23 Feb 2023 17:17 UTC

On 2/23/23 11:52 AM, James Kuyper wrote:
> On 2/23/23 11:24, Paavo Helde wrote:
>> 23.02.2023 18:00 Muttley@dastardlyhq.com kirjutas:
>>
>>>
>>> Unlike letters the characters for digits don't change unless you're
>>> talking
>>> about something like ancient egyptian.
>>
>> You are funny!
>>
>> I was bored, so I coded a counter-example:
>>
>> #include <locale.h>
>> #include <ctype.h>
>> #include <string>
>> #include <iostream>
>>
>> int main() {
>> if (!setlocale(LC_ALL, "French_Canada.1252")) {
>> std::cerr << "Failed to set locale\n";
>> return EXIT_FAILURE;
>> }
>> std::string s = "a² + b² = c²";
>> bool result = isdigit(static_cast<unsigned char>(s[1]));
>> std::cout << "'" << s[1] << "' is " <<
>> (result? "a digit": "not a digit") << "\n";
>> }
>>
>> Output:
>>
>> '²' is a digit
>
> That's non-conforming.
> "The isdigit function tests for any decimal-digit character (as defined
> in 5.2.1)." (7.4.1.5).
>
>
> "...
> the 10 decimal digits
> 0 1 2 3 4 5 6 7 8 9" (5.2.1p3)
>
> "digits" is italicized, an ISO convention indicating that this
> constitutes the official definition of that term. '2' is on that list,
> '²' is not, and that definition allows for only 10 digits.
>

And before that it says (in p1)

Each set is further divided into a basic character set, whose contents
are given by this subclause, and a set of zero or more locale-specific
members (which are not members of the basic character set) called
extended characters.

So ALL the categories may have locale specific additions added.

So, unless a function specifically restricts its classification to just
the "basic character set", there might be extended characters in the set.

Re: Is this safe?

<tt9nkh$24rgo$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24785&group=comp.lang.c++#24785

  copy link   Newsgroups: comp.lang.c
 by: James Kuyper - Fri, 24 Feb 2023 07:05 UTC

On 2/23/23 12:17, Richard Damon wrote:
> On 2/23/23 11:52 AM, James Kuyper wrote:
....
>> That's non-conforming.
>> "The isdigit function tests for any decimal-digit character (as defined
>> in 5.2.1)." (7.4.1.5).
>>
>>
>> "...
>> the 10 decimal digits
>> 0 1 2 3 4 5 6 7 8 9" (5.2.1p3)
>>
>> "digits" is italicized, an ISO convention indicating that this
>> constitutes the official definition of that term. '2' is on that list,
>> '²' is not, and that definition allows for only 10 digits.
>>
>
> And before that it says (in p1)
>
> Each set is further divided into a basic character set, whose contents
> are given by this subclause, and a set of zero or more locale-specific
> members (which are not members of the basic character set) called
> extended characters.
>
> So ALL the categories may have locale specific additions added.
>
> So, unless a function specifically restricts its classification to just
> the "basic character set", there might be extended characters in the set.

My apologies. I accidentally posted that to the wrong newsgroup, and
then deleted it (on groups.google.com) and reposted it to the correct
group (comp.lang.c++).
I've responded to other messages of yours on this issue in that thread
on comp.lang.c++. If you don't believe that I've resolved the issue with
those messages, please respond in that newsgroup, rather than this one.

Re: Is this safe?

<86lekk9yc0.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24816&group=comp.lang.c++#24816

  copy link   Newsgroups: comp.lang.c
 by: Tim Rentsch - Sun, 26 Feb 2023 16:38 UTC

Richard Damon <Richard@Damon-Family.org> writes:
> On 2/23/23 11:52 AM, James Kuyper wrote:
>> On 2/23/23 11:24, Paavo Helde wrote:
>>
>>> [example]
>>
>> That's non-conforming.
>> "The isdigit function tests for any decimal-digit character (as
>> defined in 5.2.1)." (7.4.1.5).
>>
>> "...
>> the 10 decimal digits
>> 0 1 2 3 4 5 6 7 8 9" (5.2.1p3)
>>
>> "digits" is italicized, an ISO convention indicating that this
>> constitutes the official definition of that term. [only those
>> 10 characters are allowed, not any others.]
>
> And before that it says (in p1)
>
> Each set is further divided into a basic character set, whose
> contents are given by this subclause, and a set of zero or more
> locale-specific members (which are not members of the basic
> character set) called extended characters.
>
> So ALL the categories may have locale specific additions added.
>
> So, unless a function specifically restricts its classification to
> just the "basic character set", there might be extended characters
> in the set.

You are misreading the meaning here. The phrase "Each set" in
section 5.2.1 paragraph 1 refers only to the two sets mentioned in
that paragraph, namely, the source character set and the execution
character set; it does not refer to the several named collections
of characters given in paragraph 3, which collections are not even
identified in the C standard as "sets", including in the passages
mentioning them in section 7.4.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor