Can you add more than one attribute to an identifier in C with gcc?
Here is what I have now. I left out the include statements because they get scramble in the post.
If there is a way to add two, what is the general syntax, and how can I do it both with the defintion, and with a prototype? Thank you. 🙂
main() {
printf("In Main\n");
}
__attribute__ ((constructor)) void beforeMain(void)
{
printf("Before Main\n");
}
There are two different ways of specifying multiple attributes in C with GCC:
The code above compiles and runs correctly for me under GCC versions 4.4.3 and 12.3.0.