I think this can be splitted into two issues.

a. "8: error: '__nmatch' undeclared"
b. "8: error: constant expression expected"   (when declaring 'size_t
__nmatch = 1'  before the function).

Fix for a: __nmatch (and all previous parameters) must be considered
belonging to the outside scope variables.
Fix for b: If it is a non-constant integer expression, just ignore it as if
[] was given. (I assume only constant expressions are utilized for bounds
checking when enabled).

PS. Is anyone currently tracking reported bugs?

On Thu, 2 Sept 2021 at 09:54, <[email protected]> wrote:

> Hi All.
>
> Latest mob (and earlier) don't handle declaration of a variable length
> array parameter when the length is specified by an earlier parameter. Here
> is a test file:
>
> -------------------
> #include <stdlib.h>
>
> typedef struct { int x, y; } regex_t;
> typedef struct { int x, y; } regmatch_t;
>
> extern int regexec (const regex_t *__preg,
>                     const char *__String, size_t __nmatch,
>                     regmatch_t __pmatch[__nmatch],
>                     int __eflags);
> -------------------
>
> This goes through GCC, pcc, and clang with no problems.  Can someone
> fix this?  After recent changes in GNULIB, I can no longer compile
> gawk with tcc because of this issue.
>
> Thanks!
>
> Arnold
>
> _______________________________________________
> Tinycc-devel mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to