[Xapian-devel] str.h warning in MSVC 9.0

Kelm, Peter ST/HZA-TG kelmpte at schaeffler.com
Tue May 5 17:59:44 BST 2009


what do you mean by "less good"? Is the difference sensible? If so, where?

Personally, I had issues with understanding that code line initially. So, in terms of readability I would prefer Eric's variant. Furthermore, I would argue for not turning it off globally - as this will silence it also in cases where we might want it to show up.

BTW: I tried your modified version but the warning remains. The code works, however (MSVC++ 2008 Express).


-----Ursprüngliche Nachricht-----
Von: xapian-devel-bounces at lists.xapian.org [mailto:xapian-devel-bounces at lists.xapian.org] Im Auftrag von Olly Betts
Gesendet: Dienstag, 5. Mai 2009 17:43
An: Eric Sellin
Cc: Xapian Development
Betreff: Re: [Xapian-devel] str.h warning in MSVC 9.0

On Tue, May 05, 2009 at 04:19:59PM +0100, Eric Sellin wrote:
> inline std::string str(bool value) {
>   return value? "1": "0";
> }
> ...and be done with it :)

The code generated by that variant was less good in my tests when I implemented these functions, and I'm not going to choose worse code just to placate a bogus warning which is of marginal value even when working correctly.  We can just turn it off globally and really be done with it.


More information about the Xapian-devel mailing list