* link/z80/lkgb.c,
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Jun 2006 21:22:45 +0000 (21:22 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Jun 2006 21:22:45 +0000 (21:22 +0000)
* link/z80/lkgg.c,
* src/pic16/gen.c,
* src/pic16/main.c,
* src/pic16/pcode.c,
* src/pic/main.c,
* src/pic/pcoderegs.c,
* src/SDCCicode.c,
* src/SDCCmain.c,
* src/SDCCsymt.c: replaced all exit(-1) by exit(EXIT_FAILURE) to fix
  bug 1504689 on minGW

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4222 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
link/z80/lkgb.c
link/z80/lkgg.c
src/SDCCicode.c
src/SDCCmain.c
src/SDCCsymt.c
src/pic/main.c
src/pic/pcoderegs.c
src/pic16/gen.c
src/pic16/main.c
src/pic16/pcode.c

index ca9b1fe33ff16d7e38c1c679f55a87f8434a21db..84f9228923a85726db043fe46522c1d31bddcad9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-06-12 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * link/z80/lkgb.c,
+       * link/z80/lkgg.c,
+       * src/pic16/gen.c,
+       * src/pic16/main.c,
+       * src/pic16/pcode.c,
+       * src/pic/main.c,
+       * src/pic/pcoderegs.c,
+       * src/SDCCicode.c,
+       * src/SDCCmain.c,
+       * src/SDCCsymt.c: replaced all exit(-1) by exit(EXIT_FAILURE) to fix
+         bug 1504689 on minGW
+
 2006-06-12 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
 
        * device/lib/printf_tiny.c: fixed bug #1465675 (%x format specifier)
index 63af393f45d99c22ebb3929340ec577074dbc286..55ae41ff7b020bc64f88c3742f8a5f5681c0edf2 100644 (file)
@@ -45,7 +45,7 @@ VOID gb(int in)
     for(i = 0; i < NBSEG; i++) {
       if((cart[i] = malloc(SEGSIZE)) == NULL) {
        fprintf(stderr, "ERROR: can't allocate %dth segment of memory (%d bytes)\n", i, (int)SEGSIZE);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       memset(cart[i], FILLVALUE, SEGSIZE);
     }
@@ -61,19 +61,19 @@ VOID gb(int in)
       /* Perform some validity checks */
       if(pos >= ROMSIZE) {
        fprintf(stderr, "ERROR: address overflow (addr %lx >= %lx)\n", pos, ROMSIZE);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       if(current_rom_bank >= nb_rom_banks) {
        fprintf(stderr, "ERROR: bank overflow (addr %x > %x)\n", current_rom_bank, nb_rom_banks);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       if(current_rom_bank > 0 && pos < BANKSTART) {
        fprintf(stderr, "ERROR: address underflow (addr %lx < %lx)\n", pos, BANKSTART);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       if(nb_rom_banks == 2 && current_rom_bank > 0) {
        fprintf(stderr, "ERROR: only 1 32kB segment with 2 bank\n");
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       if(current_rom_bank > 1)
        pos += (current_rom_bank-1)*BANKSIZE;
@@ -85,7 +85,7 @@ VOID gb(int in)
            cart[pos/SEGSIZE][pos%SEGSIZE] = rtval[i];
          } else {
            fprintf(stderr, "ERROR: cartridge size overflow (addr %lx >= %lx)\n", pos, CARTSIZE);
-           exit(-1);
+           exit(EXIT_FAILURE);
          }
          pos++;
        }
index d8248d6ef05ae4313b4441a35c0793b24a2d9dda..3e8bb37a2e03577fd07afc5fefd1cab2f56d10ba 100644 (file)
@@ -9,7 +9,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <ctype.h>
 #include <string.h>
 #include "aslink.h"
 
@@ -34,7 +33,7 @@ VOID gg(int in)
     for(i = 0; i < NBSEG; i++) {
       if((cart[i] = malloc(SEGSIZE)) == NULL) {
        fprintf(stderr, "ERROR: can't allocate %dth segment of memory (%d bytes)\n", i, (int)SEGSIZE);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       memset(cart[i], 0, SEGSIZE);
     }
@@ -50,7 +49,7 @@ VOID gg(int in)
       /* Perform some validity checks */
       if(pos >= ROMSIZE) {
        fprintf(stderr, "ERROR: address overflow (addr %lx >= %lx)\n", pos, ROMSIZE);
-       exit(-1);
+       exit(EXIT_FAILURE);
       }
       if(current_rom_bank > 1)
        pos += (current_rom_bank-1)*BANKSIZE;
@@ -62,7 +61,7 @@ VOID gg(int in)
            cart[pos/SEGSIZE][pos%SEGSIZE] = rtval[i];
          } else {
            fprintf(stderr, "ERROR: cartridge size overflow (addr %lx >= %lx)\n", pos, CARTSIZE);
-           exit(-1);
+           exit(EXIT_FAILURE);
          }
          pos++;
        }
index 30af1cd43f1c7745d73dd45834fe179ad73b9618..bc5bf842316a868183fe0d0b31d3c2a958529432 100644 (file)
@@ -4475,6 +4475,6 @@ operand *validateOpType(operand         *op,
             " expected %s, got %s\n",
             macro, args, file, line,
             opTypeToStr(type), op ? opTypeToStr(op->type) : "null op");
-    exit(-1);
+    exit(EXIT_FAILURE);
     return op; // never reached, makes compiler happy.
 }
index 770cbff09b272bb6f389e42c659632c8da504236..df97f51128c663943e0ddda21d1c76d3db7209f9 100644 (file)
@@ -710,7 +710,7 @@ getStringArg(const char *szStart, char **argv, int *pi, int argc)
         {
           werror (E_ARGUMENT_MISSING, szStart);
           /* Die here rather than checking for errors later. */
-          exit(-1);
+          exit(EXIT_FAILURE);
         }
       else
         {
@@ -1617,7 +1617,7 @@ linkEdit (char **envp)
                       fprintf(stderr,
                         "Add support for your FLAT24 target in %s @ line %d\n",
                         __FILE__, __LINE__);
-                      exit(-1);
+                      exit(EXIT_FAILURE);
                     }
                   break;
                 case MODEL_PAGE0:
@@ -1665,7 +1665,7 @@ linkEdit (char **envp)
                   fprintf(stderr,
                     "Add support for your FLAT24 target in %s @ line %d\n",
                     __FILE__, __LINE__);
-                  exit(-1);
+                  exit(EXIT_FAILURE);
                 }
               }
 #endif
@@ -2313,7 +2313,7 @@ main (int argc, char **argv, char **envp)
   atexit(rm_tmpfiles);
 
   /* install signal handler;
-     it's only purpuse is to call exit() to remove temp files */
+     it's only purpose is to call exit() to remove temp files */
   if (!getenv("SDCC_LEAVE_SIGNALS"))
     {
       signal (SIGABRT, sig_handler);
index 9be6c7f5d3f97ca22ffae209848cbcc619b55853..8031d9fce9013670b908847798febf6a74f6f26d 100644 (file)
@@ -1428,8 +1428,7 @@ checkSClass (symbol * sym, int isProto)
     fprintf (stderr, "checkSClass: %s \n", sym->name);
   }
   
-  /* type is literal can happen for enums change
-     to auto */
+  /* type is literal can happen for enums change to auto */
   if (SPEC_SCLS (sym->etype) == S_LITERAL && !SPEC_ENUM (sym->etype))
     SPEC_SCLS (sym->etype) = S_AUTO;
   
@@ -3552,7 +3551,7 @@ sym_link *validateLink(sym_link         *l,
             " expected %s, got %s\n",
             macro, args, file, line, 
             DECLSPEC2TXT(select), l ? DECLSPEC2TXT(l->class) : "null-link");
-    exit(-1);
+    exit(EXIT_FAILURE);
     return l; // never reached, makes compiler happy.
 }
 
index a10755af0f190a21aa88fb0d607e7dcfab6887db..efca60eaa99c71149c5cc9e9e7794cf663253cf4 100644 (file)
@@ -166,7 +166,7 @@ _pic14_parseOptions (int *pargc, char **argv, int *i)
        if(!strncmp(buf, argv[ *i ], strlen(buf))) {
                if(strlen(argv[ *i ]) <= strlen(buf)+1) {
                        fprintf(stderr, "WARNING: no `%s' entered\n", buf+2);
-                       exit(-1);
+                       exit(EXIT_FAILURE);
                } else {
                        udata_section_name = strdup( strchr(argv[*i], '=') + 1 );
                }
index 7b4d095a320ba28f95de2ec5f490a9c160d2c398..0c8f4bebed9c1dc485ee9726b5e23259cb100b97 100644 (file)
@@ -1287,7 +1287,7 @@ static int pCodeRemove (pCode *pc, const char *comment)
        else
        {
                fprintf (stderr, "Cannot move a label...\n");
-               exit(-1);
+               exit(EXIT_FAILURE);
        }
        
        if (comment)
index 19d1290b35e1457802899b977ff45d77fd04d6d5..1b16d206a74b70399d21944942d8fe8dbe04dfab 100644 (file)
@@ -6047,7 +6047,7 @@ static void genCmp (operand *left, operand *right,
         pic16_emitcode("anl","c,/%s",AOP(left)->aopu.aop_dir);
         
         werror(W_POSSBUG2, __FILE__, __LINE__);
-        exit(-1);
+        exit(EXIT_FAILURE);
     }
     
     /* if literal is on the right then swap with left */
@@ -10719,7 +10719,7 @@ static void genUnpackBits (operand *result, operand *left, char *rname, int ptyp
 
   fprintf(stderr, "SDCC pic16 port error: the port currently does not support *reading*\n");
   fprintf(stderr, "bitfields of size >=8. Instead of generating wrong code, bailling out...\n");
-  exit(-1);
+  exit(EXIT_FAILURE);
 
   return ;
 }
@@ -11526,7 +11526,7 @@ static void genPackBits (sym_link    *etype , operand *result,
 #if 0
   fprintf(stderr, "SDCC pic16 port error: the port currently does not support\n");
   fprintf(stderr, "bitfields of size >=8. Instead of generating wrong code, bailling out...\n");
-  exit(-1);
+  exit(EXIT_FAILURE);
 #endif
 
 
index c27a2bdfd07cf0f09dbee6d9f53deaadcb31689b..7b064565cf4dd6eb2dfa7cd6899ce96c3cc6f844 100644 (file)
@@ -233,7 +233,7 @@ _process_pragma(const char *sz)
         if (stackPos+stackLen > pic16->RAMsize) {
           fprintf (stderr, "%s:%u: error: stack [0x%03X,0x%03X] is placed outside available memory [0x000,0x%03X]!\n",
                filename, lineno-1, stackPos, stackPos+stackLen-1, pic16->RAMsize-1);
-          exit(-1);
+          exit(EXIT_FAILURE);
           return 1;    /* considered an error, but this reports "invalid pragma stack"... */
         }
       }
@@ -266,7 +266,7 @@ _process_pragma(const char *sz)
 
       if (!symname || !location) {
         fprintf (stderr, "%s:%d: #pragma code [symbol] [location] -- symbol or location missing\n", filename, lineno-1);
-       exit (-1);
+       exit (EXIT_FAILURE);
         return 1; /* considered an error, but this reports "invalid pragma code"... */
       }
 
@@ -300,7 +300,7 @@ _process_pragma(const char *sz)
     
       if (!symname || !sectname) {
         fprintf (stderr, "%s:%d: #pragma udata [section-name] [symbol] -- section-name or symbol missing!\n", filename, lineno-1);
-       exit (-1);
+       exit (EXIT_FAILURE);
         return 1; /* considered an error, but this reports "invalid pragma code"... */
       }
     
@@ -516,7 +516,7 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
       else if(!STRCASECMP(stkmodel, "large"))pic16_options.stack_model = 1;
       else {
         fprintf(stderr, "Unknown stack model: %s", stkmodel);
-        exit(-1);
+        exit(EXIT_FAILURE);
       }
       return TRUE;
     }
@@ -555,7 +555,7 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
         else if(!STRCASECMP(tmp, "crlf"))pic16_nl = 1;
         else {
           fprintf(stderr, "invalid termination character id\n");
-          exit(-1);
+          exit(EXIT_FAILURE);
         }
         return TRUE;
     }
index 84947452baa7e0018c4191d85b649f05e9bebe15..baec7f296a4e5f60b86a0e2320fddd34b811d528 100644 (file)
@@ -4286,7 +4286,7 @@ pCodeOp *pic16_newpCodeOpReg(int rIdx)
     if(!r) {
        fprintf(stderr, "%s:%d Could not find a free GPR register\n",
                __FUNCTION__, __LINE__);
-       exit(-1);
+       exit(EXIT_FAILURE);
     }
   }
 
@@ -4959,7 +4959,7 @@ char *pic16_pCode2str(char *str, size_t size, pCode *pc)
        if(isPCI(pc) && (PCI(pc)->pci_magic != PCI_MAGIC)) {
                fprintf(stderr, "%s:%d: pCodeInstruction initialization error in instruction %s, magic is %x (defaut: %x)\n",
                        __FILE__, __LINE__, PCI(pc)->mnemonic, PCI(pc)->pci_magic, PCI_MAGIC);
-//             exit(-1);
+//             exit(EXIT_FAILURE);
        }
 #endif