Dear TinyCC team,

I inquire to you for the possible addition of constructor/destructor attribute 
for Linux.

While searching for why the constructor attribute seemed not to work on Linux, 
I found these two commits:

Add constructor/destructor 
support<https://repo.or.cz/tinycc.git/commit/800c3a5e0be06354f4bf232c91c58d97c9145143>
Add windows constructor/destructor 
support<https://repo.or.cz/tinycc.git/commit/df72b8d487aa6d4351a08cb7c2ef4afcb4b3b0c4>

To confirm my suspicion that constructor/destructor was only implemented for 
Windows,
I tried to compile the following code with the Windows MinGW version of TCC:

```C
#include <stdio.h>

__attribute__((constructor)) void my_constructor()
{
    printf("This is my constructor function\n");
}

int main()
{
    return 0;
}
```

```C
cd tinycc
./configure
make
./tcc.exe main.c -Iwin32/include -L.
./test.exe
This is my constructor function
```

The same code executed on a Linux machine seems to ignore the constructor 
attribute.

Would you consider adding support for constructor/destructor on Linux?

Thank you,

Michael
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to