From: borutr Date: Mon, 27 Apr 2009 17:16:10 +0000 (+0000) Subject: * fixed GCC 4.4.0 mingw compilation: X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=commitdiff_plain;h=eae1bd2f705a2c61e143c539f8c4d1e9c2b4efe6 * fixed GCC 4.4.0 mingw compilation: * sim/ucsim/cmd.src/cmdlex.l: added #include * support/cpp/sdcpp-opts.c: fixed warning: unknown conversion type character 'm' in format, use strerror(errno) instead of %m glibc extension format specifier * src/SDCCsymt.c: fixed warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' * src/pic16/pcode.c, src/pic16/glue.c: fixed warning: unknown conversion type character 'h' in format, replaced hh printf format specifier with parameter casting to unsigned char git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5438 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 88c620ba..5db8a84e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-04-27 Borut Razem + + * fixed GCC 4.4.0 mingw compilation: + * sim/ucsim/cmd.src/cmdlex.l: added #include + * support/cpp/sdcpp-opts.c: fixed warning: + unknown conversion type character 'm' in format, + use strerror(errno) instead of %m glibc extension format specifier + * src/SDCCsymt.c: fixed warning: + suggest parentheses around operand of '!' or change '&' to '&&' or + '!' to '~' + * src/pic16/pcode.c, src/pic16/glue.c: fixed warning: + unknown conversion type character 'h' in format, + replaced hh printf format specifier with parameter casting to + unsigned char + +support\cpp\sdcpp-opts.c + 2009-04-19 Philipp Klaus Krause * device/lib/z80/shift.s, device/lib/z80/memmove.s, diff --git a/sim/ucsim/cmd.src/cmdlex.l b/sim/ucsim/cmd.src/cmdlex.l index 4522fab1..ff7cf212 100644 --- a/sim/ucsim/cmd.src/cmdlex.l +++ b/sim/ucsim/cmd.src/cmdlex.l @@ -1,4 +1,5 @@ %{ +#include #include "cmdlexcl.h" #include "cmdpars.h" diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index c7623d45..6692939f 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -2324,7 +2324,7 @@ compareTypeExact (sym_link * dest, sym_link * src, int level) srcScls = SPEC_SCLS (src); /* Compensate for const to const code change in checkSClass() */ - if (!level & port->mem.code_ro && SPEC_CONST (dest)) + if ((!level & port->mem.code_ro) && SPEC_CONST (dest)) { if (srcScls == S_CODE && destScls == S_FIXED) destScls = S_CODE; diff --git a/src/pic16/glue.c b/src/pic16/glue.c index 5645e6d9..2cff5518 100644 --- a/src/pic16/glue.c +++ b/src/pic16/glue.c @@ -1399,9 +1399,9 @@ void pic16_emitConfigRegs(FILE *of) for(i=0;i<=(pic16->cwInfo.confAddrEnd-pic16->cwInfo.confAddrStart);i++) if(pic16->cwInfo.crInfo[i].emit) //mask != -1) - fprintf (of, "\t__config 0x%x, 0x%hhx\n", + fprintf (of, "\t__config 0x%x, 0x%02x\n", pic16->cwInfo.confAddrStart+i, - pic16->cwInfo.crInfo[i].value); + (unsigned char) pic16->cwInfo.crInfo[i].value); } void pic16_emitIDRegs(FILE *of) @@ -1410,9 +1410,9 @@ void pic16_emitIDRegs(FILE *of) for(i=0;i<=(pic16->idInfo.idAddrEnd-pic16->idInfo.idAddrStart);i++) if(pic16->idInfo.irInfo[i].emit) - fprintf (of, "\t__idlocs 0x%06x, 0x%hhx\n", + fprintf (of, "\t__idlocs 0x%06x, 0x%02x\n", pic16->idInfo.idAddrStart+i, - pic16->idInfo.irInfo[i].value); + (unsigned char) pic16->idInfo.irInfo[i].value); } diff --git a/src/pic16/pcode.c b/src/pic16/pcode.c index 146ba2d9..6aeff8d5 100644 --- a/src/pic16/pcode.c +++ b/src/pic16/pcode.c @@ -3977,7 +3977,7 @@ pCodeOp *pic16_newpCodeOpLit(int lit) pcop->name = NULL; //if(lit>=0) - sprintf(s,"0x%02hhx", (unsigned char)lit); + sprintf(s,"0x%02x", (unsigned char) lit); //else // sprintf(s, "%i", lit); diff --git a/support/cpp/sdcpp-opts.c b/support/cpp/sdcpp-opts.c index 3f863f47..3a09f7a9 100644 --- a/support/cpp/sdcpp-opts.c +++ b/support/cpp/sdcpp-opts.c @@ -564,7 +564,7 @@ sdcpp_common_post_options (const char **pfilename) if (out_stream == NULL) { - fatal_error ("opening output file %s: %m", out_fname); + fatal_error ("opening output file %s: %s", out_fname, strerror(errno)); return false; } @@ -641,7 +641,7 @@ sdcpp_common_finish (void) { deps_stream = fopen (deps_file, deps_append ? "a": "w"); if (!deps_stream) - fatal_error ("opening dependency file %s: %m", deps_file); + fatal_error ("opening dependency file %s: %s", deps_file, strerror(errno)); } } @@ -651,10 +651,10 @@ sdcpp_common_finish (void) if (deps_stream && deps_stream != out_stream && (ferror (deps_stream) || fclose (deps_stream))) - fatal_error ("closing dependency file %s: %m", deps_file); + fatal_error ("closing dependency file %s: %s", deps_file, strerror(errno)); if (out_stream && (ferror (out_stream) || fclose (out_stream))) - fatal_error ("when writing output to %s: %m", out_fname); + fatal_error ("when writing output to %s: %s", out_fname, strerror(errno)); } /* Either of two environment variables can specify output of