21.07.2014 13:13, Alex Peshkoff wrote: >> We were using system size_t until Nickolay had committed FB_SIZE_T a few >> days ago in attempt to avoid warnings. The bad thing is that it wasnt't >> discussed. > > Not too late to begin discussion now. > I would sooner agree with the change and Nickolay's arguments to do it > (present in comment in h-file) no matter of the fact that it would be > good idea to check builds better after such changes.
Nickolay's comment is absolutely correct. However: 1) The root of the warnings issue was that size_t actively used in our classes library was often compared and/or assigned to/from shorter SLONG/ULONG variables. And the compiler was correctly showing where our code is not ready for big (>4GB) objects. Making both ULONG and FB_SIZE_T the same [smaller] size is an obvious solution, but strictly speaking it just hides the issue instead of fixing it. If one day we want to support objects bigger than 4GB, one would need to enable FB_USE_SIZE_T and start from scratch. This is not really an objection as long as FB_USE_SIZE_T is preserved, rather just a comment of mine. 2) Also, it introduces more artificial datatypes than we had. I remember we were dicussing an intention to minimize artificial datatypes in favor of native compiler ones in all places that are not ODS/API related. New API already does that. So I see the patch as a step backward in this regard. And I really hate seeing/writing typedefs in such trivial places like counter-based loops. 3) If size_t was used in any public interface, then IMHO it was a mistake. Looking at the new API, unsigned int should be used instead. IMO, FB_SIZE_T must be a private typedef and thus should be moved from types_pub.h to fb_types.h. Dmitry ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel