On 2/12/2015 8:50 PM, Doug Currie wrote:
On Thu, Feb 12, 2015 at 1:35 PM, R.Smith <rsm...@rsweb.co.za> wrote:

Now one could argue the warning should not be issued for it, or some
warnings are fine as information. Personally I prefer zero unneeded
warnings/clutter but that's just my pedantism.

My pedantism is to prefer the warning since it might catch cases where the
code inadvertently neglects to define TERM_VNULL at all.

Apologies, you misunderstand me - I am of course fully in agreement with showing the warning for valid non-executes, my point was that it is quite easy for the compiler to realize the if term depends on a prior symbol - it is not complicated and I believe it previously got this right - it should do it right.

And if something /IS/ too complicated to understand, then one shouldn't reserve an opinion on it - even if you are a C compiler.

It's easy enough to fix if you want 0 to be a valid value for TERM_VNULL:

#if TERM_VNULL
  if( pTerm->wtFlags & TERM_VNULL ) continue;
#endif

Agreed, but how easy it is to fix a problem that is not a problem is kind of irrelevant... We should write code to make systems execute efficiently and correct, not to make compilers shush.

If the warning feature starts crying wolf - it ceases to be a feature.

Anyway, enough armchair musings from me, I am sure the clang compiler designers agree with all the above, I doubt they will have a long argument about why the current way is best, it's probably really just a simple bug/oversight they might fix in a second if asked to.



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

Reply via email to