Hello, Hervé Le Borgne wrote:
> in fact, this is not a problem of compilation option. It seems it directly > comes to the template function I previously identified ( template function > string_to_integer into the file src/backends/postgresql/common.h - see > below). > Indeed, on my x86_64 architecture (but it may be different on another I > guess) > the "unsigned long" type and "long long" type are both 8 bytes. Thus the code: > const T max = (std::numeric_limits<T>::max)(); > static_cast<long long>(max) > > With T=unsigned long, it results into a value of -1 for the max value of the > (signed) long long, resulting into the identified error since the tested > value > t is not into the target range (see below). Excellent analysis, thank you very much for the effort. You are absolutely right - this is the bug that resulted from two different issues: 1. assumption that everything is a subset of long long 2. mixed signed and unsigned arithmetics > However, I must admit I don't know yet what is the best solution to solve it > properly Brute force. :-) Just committed to our repository: http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=commitdiff;h=877704fd735b8e754927821d7caaf51850aabb4e Could you please try with these modified files and let us know if it helped? (disclaimer: yes, there are probably some template tricks to refactor it and make it generic, but I do not think it is worth the effort) Regards, -- Maciej Sobczak * www.msobczak.com * www.inspirel.com ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Soci-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/soci-users
