[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Using tcc for reflection
From: |
Michael Matz |
Subject: |
Re: [Tinycc-devel] Using tcc for reflection |
Date: |
Tue, 1 Feb 2022 18:26:54 +0100 (CET) |
User-agent: |
Alpine 2.21 (LSU 202 2017-01-01) |
Hello,
On Tue, 1 Feb 2022, Domingo Alvarez Duarte wrote:
Hello Elijah !
On 1/2/22 6:30, Elijah Stone wrote:
‘cleanup’ variable attribute
It doesn't seem that tinycc has this implemented properly because testing it
with this example
https://echorand.me/site/notes/articles/c_cleanup/cleanup_attribute_c.html I
can build and execute it but there is no output (with gcc there is the
expected output).
This is deceptive! The GNU libc headers unconditionally define
'__attribute__()' to nothing if the compiler isn't GCC, and not just
internally, so a declaration like:
#include <stdio.h>
....
int __attribute__((whatever!)) avar;
doesn't set any attribute at all :-/ Either do:
#undef __attribute__
after including all standard headers, or use the other form of that token:
int __attribute((cleanup(clean_up))) avar = 1;
Ciao,
Michael.