[PATCH] Remove `attr != NULL' assert in allocate_stack.
Carlos O'Donell
codonell@redhat.com
Sat Jan 12 20:14:00 GMT 2013
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.
More information about the Libc-alpha
mailing list