Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct mystruct { int enabled:1; };
- int main()
- {
- struct mystruct s;
- s.enabled = 1;
- if(s.enabled == 1)
- printf("Is enabledn"); // we think this to print
- else
- printf("Is disabledn");
- }
- main.cpp: In function 'int main()':
- main.cpp:7:15: warning: overflow in conversion from 'int' to 'signed char:1' changes
- value from '1' to '-1' [-Woverflow]
- s.enabled = 1;
- ^
Add Comment
Please, Sign In to add comment