mac os x port: error when trying to detect __attribute__

Vincent Torri vtorri@univ-evry.fr
Sun Jan 11 06:16:00 GMT 2009


Hey,

to detect the availability of __attribute__, I use the following code:


#include <stdlib.h>

int main()
{
   int func(int x);
   int foo(int x __attribute__ ((unused)))
   {
     exit(1);
   }

   return 0;
}

but a guy told me that with his gcc version (4.0.1 or 4.2.*), he has the 
error

error: nested functions are disabled, use -fnested-functions to re-enable

Using -fnested-functions solves the problem.

My questions are:

1) why is there a problem with the mac os x port ?

2) is my test program good enough ? Is there a better way to check the 
availability of __attribute__ ?

thank you

Vincent Torri



More information about the Gcc-help mailing list