This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strtok behaviour when uninitialized


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]