← board

22 sysutils/strutils symbols FPC has and pxx does not

First, what is already right

A 35-row probe of the implemented string surface (su1.pas in the session scratch) came back byte-identical to FPC, including the cases that usually differ: Copy past the end / with count 0 / with start 0, StringReplace with rfIgnoreCase, CompareStr sign, IntToHex(-1,8), Format with a negative width, QuotedStr doubling. So nothing below is a behaviour difference — each one is a symbol that is simply absent.

Measured

Method: for each candidate, one program that calls it in its FPC signature, compiled by fpc -O- -Mobjfpc and by pxx at 35b69f6e3. Listed only where FPC compiled clean and pxx said undefined variable.

Note on method: an earlier pass probed with @Name and produced six false positives — Sqr, Odd, Trunc, Round, Frac, Int are intrinsics, and FPC refuses @ on them too. They are fine; they are not in the list.

group missing
PChar family (strings) StrCopy, StrComp, StrScan, StrPCopy, StrNew, StrDispose
string search / words AnsiPos, AnsiSameStr, WordCount, ExtractWord
directories CreateDir, RemoveDir, GetCurrentDir, SetCurrentDir, ExpandFileName, RenameFile
date/time formatting DateToStr, TimeToStr, DateTimeToStr, GetTickCount64, FileGetDate
float parsing TextToFloat (probe's call shape was rejected by FPC too — confirm the signature before implementing)

Also missing, and each one stops a program at its var line rather than at a call, so they read as worse than they are:

StrLen and StrPas ARE present, which is what makes the PChar row worth doing as a set: the family is half there, so code reaches for it and then hits a wall on the second call.

Suggested split

The rows are independent; take them a group at a time rather than as one lump. The PChar family and TStringArray+SplitString are the two that most often stop real code. Related, already filed: feature-lib-strutils-ansi-predicate-family, feature-lib-sysutils-strtodate-and-strtodatetime, feature-sysutils-decodedate-missing.

Gate

Track B: build with $(PXX_STABLE), make lib-test / demos. Each group lands with an FPC-differential test — the probe above is the shape: call it, print it, diff against fpc -O-.

Log

Resolution (2026-08-26, frank1-B-rtl)

All 22 routines and all 3 type names landed. The inventory was re-verified against the pinned stable before implementing rather than trusted: it was accurate except for one row — StrCopy/StrComp/StrScan did exist, in lib/rtl/strings.pas, and were missing only from SysUtils, which is the unit real FPC code names. That is now fixed too, so the row's premise (the family is half there) held even though three of its six entries did not.

Everything below was MEASURED by compiling the same program under fpc -O- -Mobjfpc -Sh and under pxx and diffing the output. A 103-line differential probe covering the whole set came back byte-identical.

group landed
PChar family StrPCopy StrPLCopy StrECopy StrMove StrUpper StrLower StrAlloc StrBufSize StrNew StrDispose in strings, plus the whole family re-exported from sysutils
search / words AnsiPos AnsiSameStr SameStr WordCount WordPosition ExtractWord ExtractWordPos ExtractDelimited ExtractSubstr
directories CreateDir RemoveDir ForceDirectories GetCurrentDir SetCurrentDir ExpandFileName RenameFile
date/time DateToStr TimeToStr DateTimeToStr (both arities) GetTickCount64 GetTickCount FileGetDate, plus LongTimeFormat / ShortTimeFormat / LongDateFormat
float TextToFloat (var Value: Extended, FPC's signature — a Double var still binds)
types TStringArray TStringDynArray TProcedure TFloatFormat
beyond the inventory FPC's four-argument FloatToStrF, which was a compile error here

The contracts a plausible implementation gets wrong

These are why the ticket asked for measurement, and each one was measured:

One deliberate divergence, escalated

FPC ships two incompatible StrAllocsstrings allocates prefix-free, sysutils with a 4-byte size prefix — so uses SysUtils, Strings pairs the first with the second's StrBufSize/StrDispose. Measured: that reads 4294967292 and frees p-4. We ship one implementation; single-unit programs (i.e. all of them) see exactly FPC, and only the programs FPC corrupts can tell the difference. Filed for the owner as decide-stralloc-one-implementation-or-fpcs-two.

Compiler bugs found, none worked around in lib/rtl

Only the tests were adjusted around these (documented in place, with the slug to revert at); no library code was reshaped.

Parked

bug-b-f-fixed-point-rounding-of-a-tie-goes-down-where-fpc-goes-up — the one row of twenty where FloatToStrF differs from FPC. Pre-existing in FmtFixed and already reachable through Format('%.2f'); last-digit-only, so Track F by definition (devdocs/progress/float/).

Tests

test/lib_strings_pchar.pas, test/lib_strutils_words.pas, test/lib_sysutils_dirs_dates.pas — wired into lib-test. All three compile and pass under FPC as well as pxx, which is what makes them oracles rather than recordings of our own behaviour.

Gate: make lib-test green end to end. The one failure in that target, MIMIC-XML-ETREE, is pre-existing and unrelated — verified by reverting these three RTL files and watching it fail identically; it is already held in working/bug-n-a-callable-value-reaches-a-str-parameter-and-renders-as-bound-method.