mac os x port: error when trying to detect __attribute__

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

 




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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux