This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove `attr != NULL' assert in allocate_stack.
- From: "Carlos O'Donell" <codonell at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 12 Jan 2013 15:14:27 -0500
- Subject: Re: [PATCH] Remove `attr != NULL' assert in allocate_stack.
- References: <50EF9722.6050105@redhat.com> <87y5fyaehu.fsf@kepler.schwinge.homeip.net>
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.