tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] TinyCC does not accept variable-length static qualifi


From: Michael Matz
Subject: Re: [Tinycc-devel] TinyCC does not accept variable-length static qualifier for function parameter arrays
Date: Tue, 1 Mar 2022 15:55:08 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Mon, 28 Feb 2022, John Scott wrote:

On Mon, 2022-02-28 at 09:25 +0100, david.koch@libertysurf.fr wrote:
Gcc allows this, but Gcc is not conformant and creates "extensions" as it see 
fit.
This is not a GCC extension; it's my understanding that this is pure
C99. N2310 [1] (a C17 draft) 6.7.6.3 says

A declaration of a parameter as "array of type" shall be adjusted to
"qualified pointer to type", where the type qualifiers (if any) are
those specified within the [ and ] of the array type derivation. If the
keyword static also appears within the [ and ] of the array type
derivation, then for each call to the function, the value of the
corresponding actual argument shall provide access to the first element
of an array with at least as many elements as specified by the size
expression.

Correct me if I'm wrong, but isn't argc+1 an expression?

You are correct, it's ISO C and tcc isn't conforming in rejecting this. Patches welcome :-)


Ciao,
Michael.


[1] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf




reply via email to

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