• Source
    1. #include <stdio.h>
    2. #include <assert.h>
    3.  
    4. int main()
    5. {
    6. char x = 7;
    7.  
    8. /* Some big code in between and let's say x
    9.   is accidentally changed to 9 */
    10. x = 20;
    11.  
    12. // Programmer assumes x to be 7 in rest of the code
    13. #warning "this is warning message"
    14. #error "there is error message"
    15. assert(x==7);
    16.  
    17. /* Rest of the code */
    18.  
    19. return 0;
    20. }
    21.