Re: [sqlite] Long long int constants in sources
On Wed, 25 Dec 2019 at 01:24, Clemens Ladisch wrote: > Max Vlasov wrote: > > bcc 5.5 compiler ... didn't like long long constants > >such as -2251799813685248LL > > If you want to make this particular compiler happy, use > -2251799813685248i64. > Thanks, this helped when I tested this scenario. Interesting that while searching and replacing I found a comment existing in 3.6.10 version (the earliest I have) and probably prior that addressed the problems with exposing 64-bit constants to compilers > /* Some compilers complain about constants of the form 0x7fff. > ** Others complain about 0x7i64. The following macro seems > ** to provide the constant while making all compilers happy. >*/ > # define MAX_ROWID (i64)( (((u64)0x7fff)<<32) | (u64)0x ) So probably it's hard to keep making all compilers (old and young) happy all the time :). Thanks to Richard and the team for at least trying to make them as happy as it's possible. Max ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Long long int constants in sources
Max Vlasov wrote: > bcc 5.5 compiler ... didn't like long long constants >such as -2251799813685248LL If you want to make this particular compiler happy, use -2251799813685248i64. Regards, Clemens ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Long long int constants in sources
On Tue, 24 Dec 2019 at 23:58, Warren Young wrote: > On Dec 24, 2019, at 12:32 PM, Max Vlasov wrote: > > > > I didn't mention it was for sqlite > > static compiling with Delphi 32 bit, that supports (also quite old) OMF > > static libraries format > > Would it be out of the question to compile SQLite to a DLL? Then you can > use any Windows C compiler. You might even be able to start using the > pre-built DLL shipped from sqlite.org. > > Absolutely. I even had a dll coming along the obj binary and sometimes used it in a program instead of static one. I might as well completely migrate to dynamic linking. I just wonder how long sqlite made do without requiring 64-bit integer arithmetic from the compiler/cpu and mostly still does. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Long long int constants in sources
On Dec 24, 2019, at 12:32 PM, Max Vlasov wrote: > > I didn't mention it was for sqlite > static compiling with Delphi 32 bit, that supports (also quite old) OMF > static libraries format Would it be out of the question to compile SQLite to a DLL? Then you can use any Windows C compiler. You might even be able to start using the pre-built DLL shipped from sqlite.org. I sorta get the charm of shipping around a single executable, but we invented dynamic linkage decades ago for several good reasons. Separate compilation and linkage by disparate toolchains is one of those reasons. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Long long int constants in sources
On Tue, 24 Dec 2019 at 21:37, Warren Young wrote: > On Dec 24, 2019, at 3:19 AM, Max Vlasov wrote: > > > > an "ancient" bcc 5.5 compiler > > Yes, [almost 20 years old][1] now. Even in these times of slowing > technology, that’s still a very long time in computing. > > ... > > If you need a free C compiler for Windows, you have many other options > these days. Philosophically, I suspect you’ll be happiest with MinGW, but > there are [many alternatives][3]. (Some of those listed don’t run on > Windows, but most do.) > > > Thanks for thoughts and suggestions. I didn't mention it was for sqlite static compiling with Delphi 32 bit, that supports (also quite old) OMF static libraries format, most of existing supports either COFF or ELF If I recall correctly. I'm in process of managing the task with with an upgraded embarcadero command-line compiler (clang based). It will probably solve my problem. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Long long int constants in sources
On Dec 24, 2019, at 3:19 AM, Max Vlasov wrote: > > an "ancient" bcc 5.5 compiler Yes, [almost 20 years old][1] now. Even in these times of slowing technology, that’s still a very long time in computing. To put things into perspective, that compiler is about as old as SQLite itself! It’s a wonder it’s worked as long as it has for you. > starting 3.29.00 it appears it didn't like long long constants > such as -2251799813685248LL The “LL” syntax is [a C99 feature][2], which would have been very new at the time that compiler was released. Considering that Borland C++ was well on its way to the margins of the PC software development world by the time of that release — thus the free come-on — it doesn’t surprise me that the compiler doesn’t support that particular feature of C99. Also consider that 64-bit CPUs were still in the future in the Intel x86 world. The AMD64 architecture in the first Opteron didn’t come out until 2003, and Intel didn’t release their first processor copying the architecture until the next year. That’s not to say that 32-bit compilers — such as bcc 5.5 — didn’t support 64-bit ints, but that all of this together explains why it would have been unusual to have first-class support for them at the time. There are a bunch of other things that compiler simply won’t do. It’ll choke on a whole lot of C++ template code, for one example. The MySQL++ library that I maintain has a macro-based feature that will reliably knock it over, for another. If you need a free C compiler for Windows, you have many other options these days. Philosophically, I suspect you’ll be happiest with MinGW, but there are [many alternatives][3]. (Some of those listed don’t run on Windows, but most do.) One not on that list that should be is [Visual Studio Community Edition][4], which as of 4 or 5 years ago now is as unrestricted as the old “Professional” editions, which now exist only to serve niche cases such as those still tied to MFC and AFX. [1]: https://en.wikipedia.org/wiki/Borland_C%2B%2B#Borland_C++_Compiler [2]: https://en.cppreference.com/w/c/language/integer_constant#The_type_of_the_integer_constant [3]: https://www.thoughtco.com/list-of-free-c-compilers-958190 [4]: https://visualstudio.microsoft.com/ ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users