Guest User

Untitled

a guest
Dec 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. struct mystruct { int enabled:1; };
  4. int main()
  5. {
  6. struct mystruct s;
  7. s.enabled = 1;
  8. if(s.enabled == 1)
  9. printf("Is enabledn"); // we think this to print
  10. else
  11. printf("Is disabledn");
  12. }
  13.  
  14. main.cpp: In function 'int main()':
  15. main.cpp:7:15: warning: overflow in conversion from 'int' to 'signed char:1' changes
  16. value from '1' to '-1' [-Woverflow]
  17. s.enabled = 1;
  18. ^
Add Comment
Please, Sign In to add comment