On Friday, 27 January, 2017 08:26, Clemens Ladisch <[email protected]> said:

> David Empson wrote:
> > Perhaps SQLite’s test procedure should be enforcing strict ANSI C mode?
> > If this is already being done, then the compiler(s) used might not be
> > enforcing this particular rule.
> 
> "gcc -pedantic -std=c90" (or gnu90) would check for this error:
> 
> test.c:6:3: warning: initializer element is not computable at load time [-
> Wpedantic]

But the error message/warning is of high bogosity.

While it is true that the initializer element cannot be computed at "load" 
time, it is not a "load time" item that is being initialized.  The item being 
initialized is a dynamic element on the stack inside a function call and it is 
initialized from a function argument.  It is entirely irrelevant that the 
element cannot be computed at "load time" because computing it thusly would be 
of no use whatsoever -- initialization of items residing on a functions call 
stack must always be done at "run time" and can never be done at "load time".

So the erroneous warning should just be ignored and a bug report filed against 
the compiler.




_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to