H
Hallvard B Furuseth
to find the required alignment of a struct, I've used
#include <stddef.h>
struct Align_helper {
char dummy;
struct S align;
};
enum { S_alignment = offsetof(struct Align_helper, align) };
gcc -std=c99 -pedantic says that is invalid if S has a flexible array
member:
struct S {
int a;
char c[];
};
Is there some way to find the alignment of that struct?
#include <stddef.h>
struct Align_helper {
char dummy;
struct S align;
};
enum { S_alignment = offsetof(struct Align_helper, align) };
gcc -std=c99 -pedantic says that is invalid if S has a flexible array
member:
struct S {
int a;
char c[];
};
Is there some way to find the alignment of that struct?