Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bash-3.2$ cat /tmp/x.c
- struct a {
- int a;
- };
- struct b {
- struct a a;
- };
- int main() {
- struct b b;
- b.a.a = 1;
- const struct b *bptr = &b;
- struct a *a = &bptr->a;
- return a->a;
- }
- bash-3.2$ gcc -o /tmp/x2 /tmp/x.c -Wall
- /tmp/x.c:13:12: warning: initializing 'struct a *' with an expression of type 'const struct a *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
- struct a *a = &bptr->a;
- ^ ~~~~~~~~
- 1 warning generated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement