On March 5, Richard Hipp wrote:
On Mon, Mar 5, 2012 at 7:04 AM, Sreekumar TP <sreekumar.tp at gmail.com> wrote:
> The crash is a result of -O3 flag used during compiling the library.
>
A compiler bug, then. OK. Good to know. SQLite has previously uncovered
bugs in GCC, MSVC, and LLVM. Which compiler are you using?
The fact that an optimization setting alters whether a C program crashes
or not does not imply that there is a compiler bug. Such a result might
be due to a code generation error. Or it might be due to code that is
relying upon undefined behavior, (such as evaluation order, content of
struct gaps, ad infinitum), and the exact (but undefined) behavior
changes with optimization setting. Additionally, pointer aliasing
issues, while not really in the realm of undefined behavior, can occur
at higher optimization levels. While a crash or other bad result that
arises from pointer aliasing might be counted as a compiler bug, it is
generally better for code to not create the opportunity.
Cheers,
--
Larry Brasfield
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users