This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch openformula
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit fb522d42ea94ee49e9f203292775e09021ebb62b
Author: Pedro Giffuni <[email protected]>
AuthorDate: Sat Nov 14 12:18:42 2026 -0500

    docs: G.5 Basic Limits source audit — all 4 requirements classified 
RUNTIME_PENDING
    
    ODF 1.4 §3.7 requires: (1) formulas up to at least 1024 chars,
    (2) at least 30 parameters per function, (3) strings up to 32,767
    ASCII chars, (4) at least 7 nesting levels of functions.
    
    Source audit findings:
    - Formula length: NO formula-text length limit; MAXCODE=2048 tokens
      (compiler.hxx:59), MAXSTRLEN=1024 per symbol (compiler.hxx:60).
      1026-char formula needs ~1025 tokens < 2048. Single string literal
      limited to 1023 chars (MAXSTRLEN).
    - Parameters: NO global 30-param cap; MAX uses MustHaveParamCountMin(1)
      (interpr1.cxx:3396-3400); SUM supports 255 args (calcval SG.BL-255args).
    - String length: STRING_MAXLEN=65,535 (string.hxx:119, STRING32 not
      defined) > 32,767 ODF minimum. CheckStringResultLen enforces at
      concatenation (interpre.hxx:930-936). String literals limited to
      1023 chars (MAXSTRLEN=1024).
    - Nesting depth: NO depth limit found (no MAXNEST or recursion depth
      guard). Parser uses recursive descent without depth guard
      (compiler.cxx:4134). Evaluator stack-based without depth limit.
    
    All 4 requirements classified RUNTIME_PENDING — source evidence
    supports compliance, runtime verification blocked (no AOO build tree;
    calcval macOS-only).
    
    Corrected two statements that implied runtime verification:
    - F-GAP-007: 'confirms AOO accepts 255 args' → 'expected result 255 
(unverified)'
    - F-GAP-007 (semantic audit): 'confirms AOO accepts 255 args' → 'expected 
result 255 (unverified)'
    
    No production code changes.
    
    git diff --check passed; all TSV files have correct column counts.
---
 odf_docs/openformula-small-group-semantic-audit.md | 4 ++--
 odf_docs/openformula-small-group-semantic-gaps.tsv | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/odf_docs/openformula-small-group-semantic-audit.md 
b/odf_docs/openformula-small-group-semantic-audit.md
index 47abcc8d15..6499ffa1ac 100644
--- a/odf_docs/openformula-small-group-semantic-audit.md
+++ b/odf_docs/openformula-small-group-semantic-audit.md
@@ -302,8 +302,8 @@ None required. The ScDBCount empty-cell fix (F-GAP-004) is 
implemented at source
 - `main/sc/source/core/tool/interpr1.cxx:2292-2293`: Functions like `ScAbs` 
use `MustHaveParamCount(nParamCount, 1, 2)` — bounded 1-2.
 - No global 30-parameter cap found anywhere in source.
 - Parameter count is read via `GetByte()` (`sal_uInt8`), theoretically 
supporting up to 255 parameters per call. MAXCODE=2048 tokens is the practical 
ceiling (30 params ≈ 59 tokens).
-- `test/odf-validate/calcval-cases14.tsv:201`: `SG.BL-255args` 
(`=SUM(1;1;...;255 times)`) expects 255 — confirms AOO accepts 255 args.
-- `test/odf-validate/calcval-cases14.tsv:202`: `SG.BL-256args` expects `#ERR` 
— AOO guard, not ODF-mandated.
+- `test/odf-validate/calcval-cases14.tsv:201`: `SG.BL-255args` 
(`=SUM(1;1;...;255 times)`) — expected result 255 (unverified; no runtime 
execution possible).
+- `test/odf-validate/calcval-cases14.tsv:202`: `SG.BL-256args` — expected 
`#ERR` (unverified; described in TSV as an AOO guard, not ODF-mandated).
 
 **Classification:** RUNTIME_PENDING — Source supports ≥30 parameters for 
functions whose prototypes permit lists (MAX uses `MustHaveParamCountMin`, no 
upper cap). Runtime test `SG.BL-002-30params` not executed.
 
diff --git a/odf_docs/openformula-small-group-semantic-gaps.tsv 
b/odf_docs/openformula-small-group-semantic-gaps.tsv
index 52da20d5b5..51e4e3c0c2 100644
--- a/odf_docs/openformula-small-group-semantic-gaps.tsv
+++ b/odf_docs/openformula-small-group-semantic-gaps.tsv
@@ -5,7 +5,7 @@ F-GAP-003       §6.14.6 INDEX single-argument row vector 
returns error (no row-vector
 F-GAP-004      §4.11.11        Criteria syntax supported in database functions 
main/sc/source/core/tool/interpr1.cxx:6621 (GetDBParams), :6760 (DBIterator); 
:6871-6902 (ScDBCount), :6905-6935 (ScDBCount2); dociter.cxx:685-716 
(CountRecords); queryparam.cxx:106-144 (operator prefix parsing)     Criteria 
operators parsed: <>, <=, <, >=, >, =; bQueryByString via IsNumberFormat; 
bRegExp via MayBeRegExp. DBCount empty-cell limitation RESOLVED: ScDBCount 
missing-field path uses CountRecords() (dociter.cxx:685 [...]
 F-GAP-005      §4.11.11        Database criteria: text criteria, wildcards, 
empty criteria     main/sc/source/core/tool/queryparam.cxx:106-144 (operator 
parsing); interpr1.cxx:6745-6748 (bQueryByString/bRegExp)     Text criteria 
supported via bQueryByString; wildcard/RegExp via MayBeRegExp; empty criteria 
cell (svMissing) handled as missing field   Required by ODF 1.4; partially 
verified Medium  Verify wildcard and text criteria matching      calcval: no 
dedicated wildcard/empty-criteria cases — not covered
 F-GAP-006      §3.7    Formula length at least 1024 characters 
main/sc/inc/compiler.hxx:59-60 (MAXCODE=2048 tokens, MAXSTRLEN=1024 per 
symbol); main/sc/source/core/tool/compiler.cxx:3973-3978,:2689-2691     No 
formula-text length limit; MAXCODE=2048 max tokens, MAXSTRLEN=1024 max chars 
per single symbol. A 1026-char formula needs ~1025 tokens < 2048, each token < 
1024 chars. Single string literal limited to 1023 chars. RUNTIME_PENDING — 
source capable for multi-token 1024+ char formulas; string lite [...]
-F-GAP-007      §3.7    At least 30 parameters per function where prototype 
permits     main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount 
family); main/sc/source/core/tool/interpr1.cxx:3396-3400 (ScMax uses 
MustHaveParamCountMin)    Per-function parameter count enforced via 
MustHaveParamCount/MustHaveParamCountMin/MustHaveParamCountMax. No global 
30-param cap found. MAX uses MustHaveParamCountMin(nParamCount, 1) — no upper 
cap beyond MAXCODE=2048 tokens. Parameter count via GetByte() supp [...]
+F-GAP-007      §3.7    At least 30 parameters per function where prototype 
permits     main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount 
family); main/sc/source/core/tool/interpr1.cxx:3396-3400 (ScMax uses 
MustHaveParamCountMin)    Per-function parameter count enforced via 
MustHaveParamCount/MustHaveParamCountMin/MustHaveParamCountMax. No global 
30-param cap found. MAX uses MustHaveParamCountMin(nParamCount, 1) — no upper 
cap beyond MAXCODE=2048 tokens. Parameter count via GetByte() supp [...]
 F-GAP-008      §3.7    Strings up to 32767 ASCII characters    
main/tools/inc/tools/string.hxx:110-120 (STRING_MAXLEN definition); 
main/sc/source/core/inc/interpre.hxx:930-936 (CheckStringResultLen); 
main/sc/source/core/tool/compiler.cxx:2689-2691 (MAXSTRLEN per literal)        
STRING32 not defined → default STRING_MAXLEN = 0xFFFF = 65,535 (> 32,767 ODF 
minimum). CheckStringResultLen enforces at concatenation (REPT, & operator). 
MAXSTRLEN=1024 limits individual string literals in formulas to 1023 chars (e 
[...]
 F-GAP-009      §3.7    At least 7 nesting levels of functions  
main/sc/source/core/tool/compiler.cxx (recursive descent parser at :4134); 
main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, for CHOOSE only); 
main/sc/source/core/tool/interpr1.cxx (stack-based evaluator, no depth guard)   
     No nesting depth limit (no MAXNEST or recursion depth counter). Parser 
uses recursive descent without depth guard. Evaluator is stack-based without 
explicit depth limit. MAXCODE=2048 total tokens is practical ceiling (7 n [...]
 F-GAP-010      §5.5    Operator precedence per Table 1 
main/formula/source/core/api/FormulaCompiler.cxx (parser grammar: UnionLine → 
IntersectionLine → RangeLine → UnaryLine → binary ops)    Parser structure 
exists (RangeLine/IntersectionLine/UnionLine); precedence not verified at 
runtime      Unverifiable (static); parser infrastructure present    Medium  
Runtime precedence test (2+3*4=14, 2^3^2=512)   calcval: SYN-005-precedence, 
SYN-005-power — UNVERIFIED

Reply via email to