#1 2021-04-19 05:00:33

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 226
Website

String constant truncated to fit STRING[8]

Hi Arnaud,

the compiler throws a warning [dcc32 Warning] mormot.core.json.pas(4883): W1014 String constant truncated to fit STRING[8]
at TJsonSaveContext.AddDateTime when using

W.AddShorter('T00:00:00Z') // the same pattern for date and dateTime

Regards,
Daniel

Offline

#2 2021-04-19 06:38:57

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,542
Website

Re: String constant truncated to fit STRING[8]

My bad. This is backport from mORMot1 PR391

Should be fixed by PR 26.

Also I modify a mORMot2 build script (sh) to filter a noise output of compiler (left only important warnings and errors).

The bad news is what FPC do not output any warning for such case. @ab - may be add a string length check in W.AddShorter (at last we can do such in DEBUG build), because it is very easy to shoot in the leg there.

Offline

Board footer

Powered by FluxBB