Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-07 Thread J Decker
On Fri, Oct 6, 2017 at 12:30 PM, Richard Damon wrote: > If a given macro is sometimes tested with #if defined(FOO) and other times > with #if FOO, then that would be an error unless it is intended that the > two respond differently to a #define FOO 0 statement (perhaps

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-06 Thread Richard Damon
If a given macro is sometimes tested with #if defined(FOO) and other times with #if FOO, then that would be an error unless it is intended that the two respond differently to a #define FOO 0 statement (perhaps to enable but not advertise an option). My comments were about reasons why it makes

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-05 Thread J Decker
Fixing the #if is only like 1-5% of the warnings he's complaining about... A large chunk of them are around comple options strings used for pragma compileoptions -- static const char * const azCompileOpt[] = { /* These macros are provided to "stringify" the value of the define ** for

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-05 Thread Richard Damon
On 10/5/17 8:06 PM, James K. Lowden wrote: On Fri, 29 Sep 2017 16:55:05 -0400 Igor Korot wrote: But then why not give it some default value ("0" maybe") and default it to "1" only if needed during configure? Because complexity. It takes effort --- unnecessary effort --

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-05 Thread James K. Lowden
On Fri, 29 Sep 2017 16:55:05 -0400 Igor Korot wrote: > But then why not give it some default value ("0" maybe") and default > it to "1" only if needed during configure? Because complexity. It takes effort --- unnecessary effort -- to set up that default. That effort could

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 5:12 PM, Richard Damon wrote: > On 9/29/17 2:58 PM, J Decker wrote: > >> 20 warnings “cast discards __attribute__((noreturn))” like: >>> >>> SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ >>> qualifier from pointer target

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Richard Damon
On 9/29/17 2:58 PM, J Decker wrote: 20 warnings “cast discards __attribute__((noreturn))” like: SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ qualifier from pointer target type [-Wcast-qual] memcpy((void*)[1], (const void*)>hdr, sizeof(WalIndexHdr)); 768 warnings

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Bob Friesenhahn
On Fri, 29 Sep 2017, Denis V. Razumovsky wrote: In this very thread there is a warning from GCC about #if SQLITE_4_BYTE_ALIGNED_MALLOC What can be wrong for _any_ of the compilers if you will define SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I think it should only get

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Igor Korot
Simon, On Fri, Sep 29, 2017 at 4:38 PM, Simon Slavin wrote: > > > On 29 Sep 2017, at 9:06pm, Denis V. Razumovsky wrote: > >> What can be wrong for _any_ of the compilers if you will define >> SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Simon Slavin
On 29 Sep 2017, at 9:06pm, Denis V. Razumovsky wrote: > What can be wrong for _any_ of the compilers if you will define > SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I think > it should only get better for all platforms and compilers ) If

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
On 29.09.2017 22:33, Scott Robison wrote: > On Fri, Sep 29, 2017 at 1:20 PM, Bob Friesenhahn > wrote: >> > On Fri, 29 Sep 2017, Scott Robison wrote: >>> >> >>> >> >>> >> The problem is that there is no one best practice for resolving all >>> >> such warnings in a

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
Many thanks to Mr. J Decker. I'm glad if I've made anybody think about that warnings. My mission is complete if it's true. On 29.09.2017 21:58, J Decker wrote: > On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > >> Please remove multiple warnings from compiler about

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
I am absolutely sure that sqlite is one of the best and the most tested software product in the nature and having such a point of view I was rather surprised at number of warnings coming from the compiler. I have no plans to thrust my opinion on the community, just to draw attention to the

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Scott Robison
On Fri, Sep 29, 2017 at 1:20 PM, Bob Friesenhahn wrote: > On Fri, 29 Sep 2017, Scott Robison wrote: >> >> >> The problem is that there is no one best practice for resolving all >> such warnings in a way that makes all compilers happy. It is possible >> to fix all the

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Bob Friesenhahn
On Fri, 29 Sep 2017, Scott Robison wrote: The problem is that there is no one best practice for resolving all such warnings in a way that makes all compilers happy. It is possible to fix all the warnings for one platform, then move on to the next platform and fix all its warnings, and return to

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 11:58 AM, J Decker wrote: > > > On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > >> >> SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ >> qualifier from pointer target type [-Wcast-qual] >>

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > Please remove multiple warnings from compiler about optimisation, > variable conversion, signed overflow and many more potential errors. > > 1. Optimisation solutions from GCC: > If you would like to add extra warning

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Simon Slavin
On 29 Sep 2017, at 6:14pm, Denis V. Razumovsky wrote: > Rule 10: All code must be compiled, from the first day of development, > with all compiler warnings enabled at the most > pedantic setting available. All code must compile without warnings. NASA's code is developed to run

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Scott Robison
On Fri, Sep 29, 2017 at 11:14 AM, Denis V. Razumovsky wrote: > I would like to draw attention to the document: "The Power of 10: Rules > for Developing Safety-Critical Code" from NASA/JPL Laboratory. >

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Richard Hipp
On 9/29/17, Jens Alfke wrote: > > it’s not a good idea to walk into a community and > immediately tell everyone that they’re doing things the wrong way It's worse than that. The very first sentence we heard from Mr. Razumovsky was an imperative: "Remove warnings!". And

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Jens Alfke
> On Sep 29, 2017, at 10:14 AM, Denis V. Razumovsky wrote: > > I would like to draw attention to the document: "The Power of 10: Rules > for Developing Safety-Critical Code" from NASA/JPL Laboratory. >

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
I would like to draw attention to the document: "The Power of 10: Rules for Developing Safety-Critical Code" from NASA/JPL Laboratory. https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code They tells, for example: Rule 10: All code must be compiled, from

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Jens Alfke
> On Sep 29, 2017, at 1:07 AM, Denis V. Razumovsky wrote: > > Please remove multiple warnings from compiler about optimisation, > variable conversion, signed overflow and many more potential errors. This comes up a lot. SQLite is incredibly thoroughly tested* and

[sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors. 1. Optimisation solutions from GCC: If you would like to add extra warning attributes to compile SQLite with gcc (and many others modern compilers) you will see