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] Remove `attr != NULL' assert in allocate_stack.


On 01/12/2013 05:21 AM, Thomas Schwinge wrote:
> Hi!
> 
> On Thu, 10 Jan 2013 23:37:54 -0500, "Carlos O'Donell" <codonell@redhat.com> wrote:
>> The allocate_stack function is an internal function that is used
>> only by glibc and only from pthread_create. We don't need an
>> assert on a value we control and we know to be non-NULL. Just
>> like we don't assert that pdp is non-NULL, or any other number
>> of input arguments we control entirely.
> 
> How about we use Â__attribute__ ((nonnull))Â to a) document that, and b)
> have the compiler warn in cases where this is violated (and is statically
> detectable)?  Or would that be too much effort for too little gain?  (It
> certainly makes sense for interfaces that are externally used.)

No, on the contrary I think `__attribute__ ((nonnull))' is a great idea,
I just hadn't thought about it :-)

Cheers,
Carlos.


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