]> mj.ucw.cz Git - minsk.git/blobdiff - minsk.c
Fix compiler warnings
[minsk.git] / minsk.c
diff --git a/minsk.c b/minsk.c
index 6e9845776d70cbba96aca232b067f88d9db76ee8..51d91b206001853bf687c8ed9e13c11e2a197315 100644 (file)
--- a/minsk.c
+++ b/minsk.c
@@ -16,6 +16,7 @@
 
 #define _GNU_SOURCE
 #define UNUSED __attribute__((unused))
+#define NORETURN __attribute__((noreturn))
 
 #undef ENABLE_DAEMON_MODE
 
@@ -169,7 +170,7 @@ static void wr(int addr, word val)
 
 static int lino;
 
-static void parse_error(char *msg)
+NORETURN static void parse_error(char *msg)
 {
   if (error_hook)
     error_hook("Parse error");
@@ -194,15 +195,7 @@ static void parse_in(void)
 
       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;
@@ -256,7 +249,7 @@ static word r1, r2, current_ins;
 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);
@@ -265,18 +258,18 @@ static void stop(char *reason, char *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");
@@ -801,11 +794,9 @@ static void run(void)
     }
 }
 
-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);
 }