From 8c335e22887d3f522f356aeab12394dbb905e170 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 9 Jul 2026 23:32:46 +0200 Subject: [PATCH] Define UNUSED for the clang parse so attributed parameters are not dropped MEOS marks deliberately-unused parameters with the `UNUSED` attribute macro (e.g. `Datum dist UNUSED`). The macro is defined in temporal.h, but the amalgamated parse entry point can reach a header that uses it before that definition is in scope; clang then treats `UNUSED` as an unknown token, errors on the declarator, and silently drops every remaining parameter of the prototype. This truncated several catalog signatures (the tcbuffer/tgeo segment distance turning-point helpers lost their lower/upper/t1/t2 parameters, dropping their `@param[out]` out-parameters as well). Define `UNUSED` on the clang command line so it is always in scope, independent of header ordering. --- parser/parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/parser/parser.py b/parser/parser.py index b19201c..3d9def3 100644 --- a/parser/parser.py +++ b/parser/parser.py @@ -30,6 +30,12 @@ def parse_meos(entry: Path, include_dir: Path) -> dict: "-std=c11", f"-I{include_dir}", "-DMEOS", + # Define the MEOS ``UNUSED`` attribute macro on the command line so it is + # always in scope: the amalgamated entry point may parse a header that + # uses ``UNUSED`` (e.g. ``Datum dist UNUSED``) before temporal.h defines + # it, and an undefined ``UNUSED`` makes clang error on the declarator and + # silently drop the remaining parameters of that prototype. + "-DUNUSED=__attribute__((unused))", ]) # Collect all .h files belonging to the project