Added strcmpi.c to project
[fw/sdcc] / src / SDCCmain.c
index 76a12b73d6ea7fa086a7052c3e1783085e0406c9..083ecb12557eee763c4e732e733b0800c4af6514 100644 (file)
@@ -135,6 +135,7 @@ char buffer[PATH_MAX * 2];
 #define OPTION_PACK_IRAM        "--pack-iram"
 #define OPTION_NO_PACK_IRAM     "--no-pack-iram"
 #define OPTION_NO_PEEP_COMMENTS "--no-peep-comments"
+#define OPTION_NO_GEN_COMMENTS  "--no-gen-comments"
 #define OPTION_OPT_CODE_SPEED   "--opt-code-speed"
 #define OPTION_OPT_CODE_SIZE    "--opt-code-size"
 #define OPTION_STD_C89          "--std-c89"
@@ -219,6 +220,7 @@ optionsTable[] = {
     { 0,    OPTION_NO_XINIT_OPT,    &options.noXinitOpt, "don't memcpy initialized xram from code"},
     { 0,    OPTION_NO_CCODE_IN_ASM, &options.noCcodeInAsm, "don't include c-code as comments in the asm file"},
     { 0,    OPTION_NO_PEEP_COMMENTS, &options.noPeepComments, "don't include peephole optimizer comments"},
+    { 0,    OPTION_NO_GEN_COMMENTS, &options.noGenComments, "don't include code generator comments"},
 #if !OPT_DISABLE_Z80 || !OPT_DISABLE_GBZ80
     { 0,    "--no-std-crt0", &options.no_std_crt0, "For the z80/gbz80 do not link default crt0.o"},
 #endif
@@ -1403,8 +1405,9 @@ parseCmdLine (int argc, char **argv)
         {
           struct dbuf_s path;
 
-          if (*dstPath != '\0')
+                 if (*dstPath != '\0')
             {
+              dbuf_init(&path, 128);
               dbuf_makePath (&path, dstPath, moduleNameBase);
               dbuf_c_str (&path);
               dstFileName = dbuf_detach (&path);
@@ -1451,11 +1454,11 @@ parseCmdLine (int argc, char **argv)
   if (TARGET_IS_MCS51)
     {
       options.float_rent++;
-    }
 
-  /* set up external stack location if not explicitly specified */
-  if (!options.xstack_loc)
-    options.xstack_loc = options.xdata_loc;
+      /* set up external stack location if not explicitly specified */
+      if (!options.xstack_loc)
+        options.xstack_loc = options.xdata_loc;
+    }
 
   /* if debug option is set then open the cdbFile */
   if (options.debug && fullSrcFileName)
@@ -1485,6 +1488,7 @@ linkEdit (char **envp)
   char linkerScriptFileName[PATH_MAX];
 
   linkerScriptFileName[0] = 0;
+  c = NULL;
 
   if(port->linker.needLinkerScript)
     {
@@ -1549,10 +1553,13 @@ linkEdit (char **envp)
         }
 
 #define WRITE_SEG_LOC(N, L) \
-  segName = Safe_strdup(N); \
-  c = strtok(segName, " \t"); \
-  fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
-  if (segName) { Safe_free(segName); }
+  if (N) \
+  { \
+    segName = Safe_strdup(N); \
+    c = strtok(segName, " \t"); \
+    fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
+    if (segName) { Safe_free(segName); } \
+  }
 
       if (!(TARGET_Z80_LIKE)) /*Not for the z80, gbz80*/
         {