Re: Apply attribute returns_nonnull in libiberty

2013-10-28 Thread DJ Delorie
Sure, go for it.

Re: Apply attribute returns_nonnull in libiberty

2013-10-28 Thread Marc Glisse
On Fri, 11 Oct 2013, Marc Glisse wrote: Hello, here are some uses for returns_nonnull in libiberty. Bootstrap+testsuite (default languages) on x86_64-unknown-linux-gnu. 2013-10-11 Marc Glisse PR tree-optimization/58689 include/ * ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New

Re: Apply attribute returns_nonnull in libiberty

2013-10-15 Thread Marc Glisse
On Tue, 15 Oct 2013, Jeff Law wrote: On 10/11/13 17:21, Marc Glisse wrote: The gcc-specific part now. Bootstrap+testsuite on x86_64-unknown-linux-gnu together with the libiberty patch (well, libgomp.graphite/force-parallel-4.c failed, but that randomly happens). 2013-10-12 Marc Glisse

Re: Apply attribute returns_nonnull in libiberty

2013-10-15 Thread Jeff Law
On 10/11/13 17:21, Marc Glisse wrote: The gcc-specific part now. Bootstrap+testsuite on x86_64-unknown-linux-gnu together with the libiberty patch (well, libgomp.graphite/force-parallel-4.c failed, but that randomly happens). 2013-10-12 Marc Glisse PR tree-optimization/58689 * syst

Re: Apply attribute returns_nonnull in libiberty

2013-10-14 Thread Tom Tromey
DJ> I don't think there's an official list, but if you ask gdb, binutils, DJ> newlib, and sid (I think), you've probably got it covered. Basically, DJ> everything in the src/ repository. FWIW, gdb doesn't mind. While gdb does override xmalloc, it does so in a way that avoids NULL returns. Tom

Re: Apply attribute returns_nonnull in libiberty

2013-10-14 Thread DJ Delorie
I don't think there's an official list, but if you ask gdb, binutils, newlib, and sid (I think), you've probably got it covered. Basically, everything in the src/ repository.

Re: Apply attribute returns_nonnull in libiberty

2013-10-12 Thread Marc Glisse
On Fri, 11 Oct 2013, DJ Delorie wrote: Alternatively, you could ask the other projects if they're ok with changing the xmalloc rule... Is there an official list where all the users of libiberty can be contacted? -- Marc Glisse

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread DJ Delorie
Alternatively, you could ask the other projects if they're ok with changing the xmalloc rule...

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
The gcc-specific part now. Bootstrap+testsuite on x86_64-unknown-linux-gnu together with the libiberty patch (well, libgomp.graphite/force-parallel-4.c failed, but that randomly happens). 2013-10-12 Marc Glisse PR tree-optimization/58689 * system.h (concat, reconcat, choose_

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread DJ Delorie
PR tree-optimization/58689 * ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New macro. * libiberty.h (basename, lbasename, dos_lbasename, unix_lbasename, concat_copy): Mark with attributes nonnull(1) and returns_nonnull. (concat_copy2, xstrerror): Mark with attribu

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, DJ Delorie wrote: Your patch changes the rule that the application can override xmalloc() and get functions that return NULL... How about this more limited version? I'll see about following Jakub's advice to apply the attributes to the other functions only in gcc. 2013-

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread DJ Delorie
> Why would you want to do that? I wouldn't, but gcc isn't the only user of libiberty.

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Jakub Jelinek
On Fri, Oct 11, 2013 at 02:30:13PM -0400, DJ Delorie wrote: > > Your patch changes the rule that the application can override > xmalloc() and get functions that return NULL... Why would you want to do that? Big part of libiberty itself wouldn't allow such an implementation. E.g. concat.c, argv.c

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, DJ Delorie wrote: Your patch changes the rule that the application can override xmalloc() and get functions that return NULL... Only after Jakub and Mike told me, earlier today, that this rule didn't exist anymore. If it does, we can just forget about this patch. -- Mar

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread DJ Delorie
Your patch changes the rule that the application can override xmalloc() and get functions that return NULL...

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, David Malcolm wrote: On Fri, 2013-10-11 at 19:53 +0200, Marc Glisse wrote: With the patch now... [...] -extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL; +extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL ATTRIBUTE_NONNULL(1

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread David Malcolm
On Fri, 2013-10-11 at 19:53 +0200, Marc Glisse wrote: > With the patch now... [...] > -extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL; > +extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL > ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURNS_NONNULL; An aesthet

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
With the patch now... On Fri, 11 Oct 2013, Marc Glisse wrote: Hello, here are some uses for returns_nonnull in libiberty. Bootstrap+testsuite (default languages) on x86_64-unknown-linux-gnu. 2013-10-11 Marc Glisse PR tree-optimization/58689 include/ * ansidecl.h (ATTRIBUT

Apply attribute returns_nonnull in libiberty

2013-10-11 Thread Marc Glisse
Hello, here are some uses for returns_nonnull in libiberty. Bootstrap+testsuite (default languages) on x86_64-unknown-linux-gnu. 2013-10-11 Marc Glisse PR tree-optimization/58689 include/ * ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New macro. * libiberty.h (basename, l