Skip to content

Instantly share code, notes, and snippets.

@pizzamig
Created July 28, 2016 08:30
Show Gist options
  • Save pizzamig/d9211077ff52431a25ddb418b496979b to your computer and use it in GitHub Desktop.
Save pizzamig/d9211077ff52431a25ddb418b496979b to your computer and use it in GitHub Desktop.
extended offsetof case
/* The warning is issued using -pedantic */
#include <sys/stddef.h>
struct foo
{
int i;
int j;
struct
{
int x;
int k;
} bar;
};
int main()
{
return offsetof(struct foo, bar.x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment