strtok behaviour when uninitialized
Rich Felker
dalias@libc.org
Mon Feb 12 07:51:00 GMT 2018
On Sun, Feb 11, 2018 at 08:08:05PM +0100, Javier Serrano Polo wrote:
> El dg 11 de 02 de 2018 a les 13:53 -0500, Salil Kapur va escriure:
> > Why keep it undefined?
>
> Undefined behavior means efficiency. The most efficient implementation
> will either crash or not.
Efficiency is not the issue here. The issue is that a crash is the
best way to inform the programmer that their code is incorrect. This
is expressed in the glibc wiki:
https://sourceware.org/glibc/wiki/Style_and_Conventions#Bugs_in_the_user_program
Rich
More information about the Libc-alpha
mailing list