tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] TinyCC does not accept variable-length static qualifier f


From: John Scott
Subject: [Tinycc-devel] TinyCC does not accept variable-length static qualifier for function parameter arrays
Date: Mon, 28 Feb 2022 07:06:13 +0000

Hi,

Although this is a conformant C99 program, TinyCC chokes on the
following single line program with 'error: argc undeclared':
        int main(int argc, char *argv[static argc+1]) {}

If you're not aware, the static qualifier, when used like this,
indicates that argv must point to an array of at least argc+1 elements.
This can be useful for bounds checking or optimization, but TinyCC
should not fail to compile it. Some other functions this can be useful
with are
        int getgroups(int s, gid_t[static s]);
        int regexec(const regex_t r[restrict static 1], const char s[restrict 
static 1], size_t n, regmatch_t m[restrict static n], int w);

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]