On Wed, Dec 3, 2014 at 5:46 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 4 Dec 2014, at 12:26am, James K. Lowden <jklow...@schemamania.org>
> wrote:
>
> > What to do is another question.  SQLite can surely ignore it.  If I
> > felt strongly about it, I'd submit a bug report to GCC because IIUC
> > the nonnull attribute syntax provides no way to express the constraint
> > defined by the standard, i.e. "__n > 0 || __nonnull ((1, 2))".
>
> But that's not what the standard says.  My understanding of the standard
> is that both source and destination must be legitimate memory locations.
> It says nothing about the value of n.  In other words memcpy() may well
> look at the source and destination locations before discovering that n == 0
> so it doesn't have to do anything. [1]  It's clear even in the first
> standard Clemens quoted.
>

That is the C99 standard. C90 did not have that restriction. A lot of
projects target C90 for maximum portability. In this particular case it
does not make SQLite incompatible with C90 to accommodate C99, so it has
been accommodated. Still, I would maintain that the standard being used was
not being violated in this case.

-- 
Scott Robison
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to