Advertisement
Guest User

Untitled

a guest
Jan 26th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. bash-3.2$ cat /tmp/x.c
  2. struct a {
  3. int a;
  4. };
  5.  
  6. struct b {
  7. struct a a;
  8. };
  9.  
  10. int main() {
  11. struct b b;
  12. b.a.a = 1;
  13. const struct b *bptr = &b;
  14. struct a *a = &bptr->a;
  15. return a->a;
  16. }
  17. bash-3.2$ gcc -o /tmp/x2 /tmp/x.c -Wall
  18. /tmp/x.c:13:12: warning: initializing 'struct a *' with an expression of type 'const struct a *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  19. struct a *a = &bptr->a;
  20. ^ ~~~~~~~~
  21. 1 warning generated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement