28 Feb
2007
28 Feb
'07
6:59 a.m.
Torrey Pines wrote:
Hi
With the current implementation, unsigned variables accept negative values, that get silently cast.
E.g. on my platform, if "--length" expects size_t, --length -32 assigns it a value 4294967264 without warnings or errors. This behavior surprised me, and I'm using a workaround (parsing an int, and checking its range manually).
However, is this an intended feature of the library?
Not that I indended it. The library uses lexical_cast to covert from "-32" to size_t, and I'm suprised you get what you get. I shall investigage, but would you please file a bug report about this so that I don't forget? Thanks, Volodya