#define _GNU_SOURCE
#define UNUSED __attribute__((unused))
+#define NORETURN __attribute__((noreturn))
#undef ENABLE_DAEMON_MODE
static int lino;
-static void parse_error(char *msg)
+NORETURN static void parse_error(char *msg)
{
if (error_hook)
error_hook("Parse error");
char *c = line;
if (!c[0] || c[0] == ';')
- {
- if (!strncmp(c, ";daji_zor_i_litva=", 18))
- {
- trace = atoi(c+18);
- if (error_hook)
- error_hook("Secret tracing switch flipped");
- }
- continue;
- }
+ continue;
if (c[0] == '.')
return;
static int ip = 00050; // Standard program start location
static int prev_ip;
-static void stop(char *reason, char *notice)
+NORETURN static void stop(char *reason, char *notice)
{
if (error_hook)
error_hook(notice);
exit(0);
}
-static void over(void)
+NORETURN static void over(void)
{
stop("Аварийный останов", "Overflow");
}
-static void notimp(void)
+NORETURN static void notimp(void)
{
acc = current_ins;
stop("Устройство разбитое", "Not implemented");
}
-static void noins(void)
+NORETURN static void noins(void)
{
acc = current_ins;
stop("Эту команду не знаю", "Illegal instruction");
}
}
-static void die(char *msg)
+NORETURN static void die(char *msg)
{
- fprintf(stderr, "minsk: ");
- fprintf(stderr, msg);
- fputc('\n', stderr);
+ fprintf(stderr, "minsk: %s\n", msg);
exit(1);
}