On Fri, Feb 18, 2011 at 8:12 AM, Black, Michael (IS) <michael.bla...@ngc.com > wrote:
> I'm of the opinion that all such warnings should be permanently fixed. > Such warnings do point to potential problems. > And not by disabling the warning but by fixing the code (explicit casts for > example). > > How many people try this and get worried about possible problems? If you > simply fix the code once all those people will feel a whole lot better when > they crank up the warnings and see nothing. > > I went through this exercise myself for SQLite at one point and looked at > each and every warning to try and determine if there was a possible error > caused by all the miscasts. > > I don't understand the resistance to fixing these. And I'd feel a whole > lot better with somebody who KNOWS the code saying "yeah, explicit cast is > OK here". > I do not recall an occasion where a compiler warning has helped us find an error in a released version of SQLite. However, we have introduced errors in our efforts to fix compiler warnings. Thus, in my experience, excessive worry over compiler warnings is counter-productive to software quality. This is especially true of the warnings generated by MSVC. So, which do you prefer: Software that compiles without warning, or software that works? > > Michael D. Black > Senior Scientist > NG Information Systems > Advanced Analytics Directorate > > > > ________________________________________ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Nick Shaw [nick.s...@citysync.co.uk] > Sent: Friday, February 18, 2011 3:50 AM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] Compiler warnings in R-Tree code under Visual > StudioExpress > > Afriza N. Arief wrote: > > I tried to compile SQLite 3.7.5 with SQLITE_ENABLE_RTREE=1 and got the > following warnings: > > > > sqlite3.c(120736): warning C4244: '=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(120749): warning C4244: '+=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(120834): warning C4244: '=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(121803): warning C4244: '+=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(121804): warning C4244: '+=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(121808): warning C4244: '=' : conversion from 'double' to > 'float', possible loss of data > > sqlite3.c(121815): warning C4244: 'initializing' : conversion from > 'double' > > to 'float', possible loss of data > > sqlite3.c(121914): warning C4244: 'function' : conversion from 'i64' > to 'int', possible loss of data > > sqlite3.c(121917): warning C4244: 'function' : conversion from 'i64' > to 'int', possible loss of data > > > > Thank you > > Those are warnings, not errors, so won't prevent the build completing - > You can hide the warnings with a compiler pragma: #pragma warning > (disable: 4244), or you could edit the code itself and cast the doubles > explicitly as floats. > > I don't think they're anything to be concerned about. If I compile the > code in my project (without SQLITE_ENABLE_RTREE I should note) with > Level 4 warnings on the file properties in Visual Studio, I get a ream > of warnings, but they've yet to cause any problems at all (hence I > compile with Level 3 warnings so I don't keep seeing them). > > Nick. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users