+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)
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);
}
/* 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;
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++;
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <string.h>
#include "aslink.h"
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);
}
/* 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;
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++;
}
" 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.
}
{
werror (E_ARGUMENT_MISSING, szStart);
/* Die here rather than checking for errors later. */
- exit(-1);
+ exit(EXIT_FAILURE);
}
else
{
fprintf(stderr,
"Add support for your FLAT24 target in %s @ line %d\n",
__FILE__, __LINE__);
- exit(-1);
+ exit(EXIT_FAILURE);
}
break;
case MODEL_PAGE0:
fprintf(stderr,
"Add support for your FLAT24 target in %s @ line %d\n",
__FILE__, __LINE__);
- exit(-1);
+ exit(EXIT_FAILURE);
}
}
#endif
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);
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;
" 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.
}
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 );
}
else
{
fprintf (stderr, "Cannot move a label...\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
if (comment)
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 */
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 ;
}
#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
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"... */
}
}
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"... */
}
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"... */
}
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;
}
else if(!STRCASECMP(tmp, "crlf"))pic16_nl = 1;
else {
fprintf(stderr, "invalid termination character id\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
return TRUE;
}
if(!r) {
fprintf(stderr, "%s:%d Could not find a free GPR register\n",
__FUNCTION__, __LINE__);
- exit(-1);
+ exit(EXIT_FAILURE);
}
}
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