Warning Implicit declaration posix_memalign

I am using GCC 4.9 on ubuntu 15.04. I am coding in eclipse CDT. This is program C with a dialect set to c99. For some reason, my compiler warns me about this ...

warning: implicit declaration of function β€˜posix_memalign’ [-Wimplicit-function-declaration]

I do not know why. At my #include<stdlib.h>top, and when I use eclipse, ctrl + click posix_memalign returns me to the function declaration in stdlib.h. Why am I getting this warning?

I just tried changing dialext to std = gnu99 and this fixed the problem. Is posix_memalign not included in c99?

+4
source share
1 answer

#define _POSIX_C_SOURCE 200809L #include.

, C, / C; "" #include.

posix_memalign() stdlib.h, POSIX.1-2001 ; _POSIX_C_SOURCE 200112L (L , long) _XOPEN_SOURCE 600 .

  • , stdlib.h

  • stdlib.h

  • C POSIX.1

GCC Ubuntu, , C POSIX.1.

+4

Source: https://habr.com/ru/post/1606257/


All Articles