Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-06 Thread Santiago A.
El 05/10/2016 a las 19:47, Michalis Kamburelis escribió: > 2016-10-05 9:00 GMT+02:00 Maciej Izak : >> 2016-10-05 4:32 GMT+02:00 Michalis Kamburelis : >>> For example, the call >>> >>> Format('%s', [123]) >> >> I have a small hint (instead of answer). We have in mORMot / NewPascal in >> SynCommons

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-06 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > RTL not to mention that user code that uses "array of const" wouldn't > > necessarily benefit from it. > GNU C does check this when using printf() and friends, and rather > obviously the "array of const" is modeled after the C ellipse notation.

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Michael Schnell
On 05.10.2016 07:59, Sven Barth wrote: something like this definitely wouldn't become part of the compiler as that would mean an unnecessarily tight coupling between compiler and RTL not to mention that user code that uses "array of const" wouldn't necessarily benefit from it. GNU C does check

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Michalis Kamburelis
2016-10-05 9:00 GMT+02:00 Maciej Izak : > > 2016-10-05 4:32 GMT+02:00 Michalis Kamburelis : >> >> For example, the call >> >> Format('%s', [123]) > > > I have a small hint (instead of answer). We have in mORMot / NewPascal in > SynCommons module nice function which works perfect in most of cases:

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Maciej Izak
2016-10-05 4:32 GMT+02:00 Michalis Kamburelis : > For example, the call > > Format('%s', [123]) > I have a small hint (instead of answer). We have in mORMot / NewPascal in SynCommons module nice function which works perfect in most of cases: FormatUTF8('%', [123], []); // same string '%' works

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-04 Thread Sven Barth
Am 05.10.2016 04:33 schrieb "Michalis Kamburelis" : > > Hi, > > I'm wondering if there is a tool that checks the correctness of calls > to Format and friends (like Exception.CreateFmt) in your code. Or does > someone plan to write one, as an external tool (like a "lint") or > inside the FPC compile

[fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-04 Thread Michalis Kamburelis
Hi, I'm wondering if there is a tool that checks the correctness of calls to Format and friends (like Exception.CreateFmt) in your code. Or does someone plan to write one, as an external tool (like a "lint") or inside the FPC compiler:) For example, the call Format('%s', [123]) is guaranteed