On Tue, May 11, 2010 at 09:38, Nicholas Clark <nick@ccl4.org> wrote: > On Tue, May 11, 2010 at 04:31:16PM +0100, Nicholas Clark wrote: >> On Tue, May 11, 2010 at 09:26:45AM -0600, Curtis Jewell wrote: >> > On Tue, 11 May 2010 15:22 +0100, hv@crypt.org wrote: >> > > hv@crypt.org wrote: >> > > :Alex Hunsaker <badalex@gmail.com> wrote: >> > > ::$ ./perl -Ilib/ -e 'sort glob("*")' >> > > ::Segmentation fault >> > > : >> > > :I get the same result with gcc-4.5.0 here, only with -Dusemultiplicity. >> > > [...] >> > > :I'll try to distil this down to a bug report for gcc. >> > > >> > > Now submitted as <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44081>. >> > >> > And already marked as invalid there (it may have been distilled too far >> > for them to notice the bug?) >> >> I suspect that the reader/rejector assumed that the indexes for notnull() >> start at 0. They start at 1. If you make that mistake, you would conclude >> (wrongly) what the rejector did. > > Gah. I think I'm wrong here. I'm not convinced that the test case is correct. No I think you are right. I (and the rejector) were wrong. From: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html nonnull (arg-index, ...) The nonnull attribute specifies that some function parameters should be non-null pointers. For instance, the declaration: extern void * my_memcpy (void *dest, const void *src, size_t len) __attribute__((nonnull (1, 2))); causes the compiler to check that, in calls to my_memcpy, arguments dest and src are non-null. If the compiler determines that a OK so dest == 1 and src == 2, starts at 1 :-)Thread Previous | Thread Next