As the original author of SLONG, ULONG, et al, might I suggest that you ditch 
them all in favor of the standard and size explicit int64_t, int32_t, etc.?  
Specific types for things like transaction id, record number, etc., make 
perfectly good sense, but artificial types that vary from platform to platform 
do not.

I may have mentioned that once upon a time include stdin.h in Visual Studio 
brought in all sorts of undesirable Microsoft includes, but that is happily 
ancient history.

If somebody were to do a global edit to clean up artificial types, it would 
also be a good idea to flush the "const correctness" for objects in favor of 
clean, type safe, generally cast free code.  I have no idea who came up with 
the idea of const correctness, but it violates the principal of encapsulation, 
the basis of object oriented programming.




> On Aug 25, 2014, at 4:29 PM, Nikolay Samofatov 
> <nikolay.samofa...@red-soft.biz> wrote:
> 
> Hello, Claudio, All,
> 
> I am still working on intermediate GC problem for Firebird 3, and found many 
> bugs in the code along 
> the way. I mark them up with XXX or FIXME as appropriate.
> 
> One bug in your code is particularly bad, and I kindly ask you to look at it 
> ASAP:
> 
> When you converted transaction number from SLONG to TraNumber (ULONG) you 
> didn't take into account 
> that LCK_query_data returns SLONG and uses signed integers internally. Proper 
> GC depends on this 
> function to work correctly or database corruption happens. Also, you used 
> "%lu" marker in various 
> format strings, etc for transaction numbers and this is not correct since 
> "long" is 64-bit integer 
> on some platforms and ULONG is "unsigned int" on such platforms. While 64-bit 
> binary ABI often 
> protects against problems in such situation this is not guarantied to work 
> across all platforms.
> 
> 
> Thank you,
> 
> Nikolay Samofatov
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to