fork download
  1. #include <stdio.h>
  2.  
  3. enum node_type {LEAF, NODE};
  4.  
  5. struct node {
  6. enum node_type type;
  7. };
  8.  
  9. int parse_tree( struct node* n ) {
  10. switch( n->type ) {
  11. case NODE: return 1;
  12. case LEAF: return 2;
  13. }
  14. }
  15.  
  16. int main() {
  17. struct node n;
  18. printf("%d", parse_tree(&n));
  19. return 0;
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘parse_tree’:
prog.c:14:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
stdout
Standard output is empty