tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Pointers to variable-length arrays are broken


From: Ivan Kozlov
Subject: [Tinycc-devel] Pointers to variable-length arrays are broken
Date: Fri, 03 Sep 2021 13:09:16 +0300

The following program miscompiles as of TCC 0.9.27:

#include <stdio.h>

int
main (void)
{
  size_t n = 10;
  int a[n];
  printf ("%p\n%p\n", (void *)a, (void *)*&a);
}

The second address is off. GCC 10.2.0, among others, handles this correctly.

Pointers to constant-length arrays work as intended (and indeed have the same 
representation as the address of the first element of the target array).



reply via email to

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