I want to compile this code:
#include <stdalign.h>
#include <stdio.h>
#include <stddef.h>
int main ( int argc , char ** argv )
{
printf ("%zu\n", alignof ( max_align_t ));
return 0;
}
But compiler says that:
error: ‘max_align_t’ undeclared".
stddef.h
is included and everything must be ok, isn't it?
P.S. I already tried to compile this code under gcc4.8 and gcc4.9, but I have error as described.
To use a C11 feature you need to tell the compiler to run in C11 compliant mode.
For gcc this can be achieved by specifying the option -std=c11
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With