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: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)


On 10/08/2013 05:00 PM, Torvald Riegel wrote:
>> I've documented what I understand is our practice for assert:
>> https://sourceware.org/glibc/wiki/Style_and_Conventions#Assertions
>> ~~~
>> Assertions are for internal consistency checking only.
>>
>> External conditions are governed by the API and if user 
>> code violates the API then the library behaviour is undefined.
>>
>> However, in scenarios where user input is recorded into 
>> internal structures for later use it is useful to assert 
>> in these cases to catch the first occurrence of the error. 
> 
> Perhaps it's useful to distinguish between asserts (ie, the internal
> consistency checks) and checks that test whether callers adhere to the
> preconditions required by a function?

What would you say?

Cheers,
Carlos.


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