[fpc-pascal] Cannot write datetime field on sqlite3 database on ARM

Florian Klämpfl florian at freepascal.org
Tue Mar 9 21:40:08 CET 2021

Am 09.03.21 um 01:47 schrieb Toru Takubo via fpc-pascal:
> On 2021/03/08 16:54, Michael Van Canneyt via fpc-pascal wrote:
>> On Mon, 8 Mar 2021, Toru Takubo via fpc-pascal wrote:
>>> Hi,
>>> I am developing my app on Windows and building apps for other
>>> platforms by using cross compiler. Now I have a problem only
>>> occurred on Linux ARM.
>>> The problem is that it cannot write datetime field on sqlite3
>>> database. It can read/write other fields like int, varchar
>>> or blob, but always write zero in datetime (maybe float as well)
>>> field.
>>> Does anyone have an idea about this issue? I am not sure it is
>>> fpc issue, but better to report bug?
>> It sounds like a floating point problem. As you probably know, a 
>> TDateTime
>> type is actually a double type. Did you try with a float value ?
>> The DB explorer tools probably just use strings to read/write from the
>> database, so they will not be bothere by such things, but FPC stores 
>> dataset
>> values in 'native' formats in memory.
>> I don't know what to advise to further investigate the issue, One 
>> thing to
>> try would be to test whether normal float arithmetic or date 
>> arithmetic works.
>> If not, then the compiler people will need to give more advice.
> I created a simple test code, and ran on linux-i386 and linux-arm.

Can you please post the output of -va of the arm compiler and provide 
some information about the arm system you are using?

More information about the fpc-pascal mailing list