Sujet : Re: Bart's Language
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.lang.cDate : 20. Mar 2025, 23:55:22
Autres entêtes
Organisation : To protect and to server
Message-ID : <vri6co$26v8m$2@paganini.bofh.team>
References : 1 2 3 4 5
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
bart <
bc@freeuk.com> wrote:
On 18/03/2025 15:10, Waldek Hebisch wrote:
bart <bc@freeuk.com> wrote:
On 18/03/2025 12:17, Waldek Hebisch wrote:
I see. So your feature conflicts with C feature "variable which is
initialized at declaration time is always used initialized".
That doesn't happen here:
int a = a;
gcc (with no extra options) tcc and bcc both put some undefined value in a.
gcc won't warn until you say '-Wextra', and then only for:
int a = a + 1;
Well, it is rather easy to see if variable is used within its
own initialization, so practically it is minor gap. Of course,
there is problem with C standard: IIUC depending on rest of
the code declarations as above are merely undefined behaviour
or even produce unspecified value. So C compiler is
forbidden to stop compilation are report compile time error.
However, your language has no constrains that C has, so you
could do better.
-- Waldek Hebisch