The more interesting question
Timon Gehr
timon.gehr at gmx.ch
Tue May 15 11:30:28 PDT 2012
On 05/15/2012 06:19 PM, Gor Gyolchanyan wrote:
>
>
> On Tue, May 15, 2012 at 7:51 PM, Christophe
> <travert at phare.normalesup.org <mailto:travert at phare.normalesup.org>> wrote:
>
> using printf will lead to a bug each time the programmer forget the
> trailing
> \0.
>
>
> First of all, printf shouldn't be used!
First of all, 'is' shouldn't be used to compare built-in arrays!
> There's writef and it's superior to printf in any way!
No it is not! printf and scanf are so much faster than writef/readf that
it is relevant! The poor performance of writef/readf makes it
embarrassing for a university to use D as a teaching language!
> Second of all, if the zero-termination of literals are to be removed,
> the literals will no longer be accepted as a pointer to a character.
> The appropriate type mismatch error will force the user to use toUTF8z
> to get ht e zero-terminated utf-8 version of the original string.
> In case it's a literal, one could use the compile-time version of
> toUTF8z to avoid run-time overhead.
> This all doesn't sound like a bad idea to me. I don't see any security
> or performance flaws in this scheme.
There are none in the current scheme.
More information about the Digitalmars-d
mailing list