Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: How many wide characters may mbstowcs store?
Date: Tue, 26 May 2020 07:09:12 -0700
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <86y2pess8n.fsf@linuxsc.com>
References: <86mu6exxpw.fsf@linuxsc.com> <86k112u2kx.fsf@linuxsc.com> <87tv06qr7q.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="92a08c9ac951f54b23642bdecebd1a9c"; logging-data="5870"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OAREYdSf2njfzP4hOu7kzgDL7gTWhYT8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:ON3BHfIj6i9zXtSH8ylr+SWMeTk= sha1:ldZtFK9AIbhrX4XlKLlNCarDhfk=
Xref: csiph.com comp.lang.c:152484
Keith Thompson writes:
> Philipp Klaus Krause writes:
> [...]
>
>> The correct thing to do would be to file a bug against the gcc package
>> in Ubuntu (after all it is an Ubunt-specific patch that makes gcc
>> non-stdandard-compliant - on upstream GNU GCC the non-compliant
>> behaviour would need to be explicitly requested by the user). However, I
>> guess the bug report would be rejected, as Ubuntu considers
>> non-standard-compliance in this respect a feature (much like OpenBSD
>> with their non-standard-compliant rand()).
>> I'll just leave the filing of a bug report to a real Ubuntu user.
>
> I don't think I had heard this about OpenBSD's rand().
>
> Here's the man page: https://man.openbsd.org/rand
>
> Standards insist that this interface return deterministic
> results. Unsafe usage is very common, so OpenBSD changed the
> subsystem to return non-deterministic results by default.
>
> They add a non-standard srand_deterministic() that causes rand() to
> yield the required deterministic results.
Thank you for posting this. Yet another reason never to use
rand().
> Personally, I think this was a very bad idea.
I absolutely, categorically, emphatically and unequivocally
completely agree. What were they thinking???