Previously this file would fail to compile with the following error:
$ gcc manual/examples/setjmp.c
manual/examples/setjmp.c: In function ‘main’:
manual/examples/setjmp.c:37:7: error: implicit declaration of function ‘do_command’ [-Wimplicit-function-declaration]
37 | do_command ();
| ^~~~~~~~~~
manual/examples/setjmp.c: At top level:
manual/examples/setjmp.c:42:1: warning: conflicting types for ‘do_command’; have ‘void(void)’
42 | do_command (void)
| ^~~~~~~~~~
manual/examples/setjmp.c:37:7: note: previous implicit declaration of ‘do_command’ with type ‘void(void)’
37 | do_command ();
| ^~~~~~~~~~
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
longjmp (main_loop, status);
}
-int
-main (void)
-{
- while (1)
- if (setjmp (main_loop))
- puts ("Back at main loop....");
- else
- do_command ();
-}
-
-
void
do_command (void)
{
else
exit (EXIT_SUCCESS);
}
+
+int
+main (void)
+{
+ while (1)
+ if (setjmp (main_loop))
+ puts ("Back at main loop....");
+ else
+ do_command ();
+}