#include <stdio.h> enum node_type {LEAF, NODE}; struct node { enum node_type type;}; int parse_tree( struct node* n ) { switch( n->type ) { case NODE: return 1; case LEAF: return 2; } } int main() { struct node n; printf("%d", parse_tree(&n)); return 0;}
Standard input is empty
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
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!