// Globally accessible scratch buffer for file names.
char scratchFileName[PATH_MAX];
-char buffer[PATH_MAX];
+char buffer[PATH_MAX * 2];
// In MSC VC6 default search path for exe's to path for this
#define OPTION_DATA_LOC "--data-loc"
#define OPTION_CODE_LOC "--code-loc"
#define OPTION_IDATA_LOC "--idata-loc"
+#define OPTION_NO_LABEL_OPT "--nolabelopt"
#define OPTION_NO_LOOP_INV "--noinvariant"
#define OPTION_NO_LOOP_IND "--noinduction"
#define OPTION_LESS_PEDANTIC "--lesspedantic"
{ 0, "--stack-10bit", &options.stack10bit, "use the 10bit stack for ds390 (default)" },
{ 0, "--xstack", &options.useXstack, "Use external stack" },
{ 0, OPTION_NO_GCSE, NULL, "Disable the GCSE optimisation" },
+ { 0, OPTION_NO_LABEL_OPT, NULL, "Disable label optimisation" },
{ 0, OPTION_NO_LOOP_INV, NULL, "Disable optimisation of invariants" },
{ 0, OPTION_NO_LOOP_IND, NULL, NULL },
{ 0, "--nojtbound", &optimize.noJTabBoundary, "Don't generate boundary check for jump tables" },
" (CYGWIN)\n"
#elif defined __MINGW32__
" (MINGW32) \n"
-#else
-# ifdef __DJGPP__
+#elif defined __DJGPP__
" (DJGPP) \n"
-# else
-# if defined(_MSC_VER)
- " (WIN32) \n"
-# else
+#elif defined(_MSC_VER)
+ " (MSVC) \n"
+#elif defined(__BORLANDC__)
+ " (BORLANDC) \n"
+#else
" (UNIX) \n"
-# endif
-# endif
#endif
,VersionString
}
/* copy the file name into the buffer */
- strncpyz (buffer, s, PATH_MAX);
+ strncpyz (buffer, s, sizeof(buffer));
/* get rid of the "."-extension */
continue;
}
+ if (strcmp (argv[i], OPTION_NO_LABEL_OPT) == 0)
+ {
+ optimize.label4 = 0;
+ continue;
+ }
+
if (strcmp (argv[i], OPTION_NO_LOOP_IND) == 0)
{
optimize.loopInduction = 0;
char *p;
/* copy the file name into the buffer */
- strncpyz(buffer, getStringArg("-o", argv, &i, argc), PATH_MAX);
+ strncpyz(buffer, getStringArg("-o", argv, &i, argc),
+ sizeof(buffer));
/* point to last character */
p = buffer + strlen (buffer) - 1;
if (*p == DIR_SEPARATOR_CHAR)
char *objectName;
size_t bufSize;
- strncpyz (buffer, relFiles[0], PATH_MAX);
+ strncpyz (buffer, relFiles[0], sizeof(buffer));
/* remove extension (it must be .rel) */
*strrchr (buffer, '.') = '\0';
/* remove path */
{
char buffer2[PATH_MAX];
buildCmdLine (buffer2, port->linker.cmd, dstFileName, scratchFileName, NULL, NULL);
- buildCmdLine2 (buffer, buffer2, PATH_MAX);
+ buildCmdLine2 (buffer, buffer2, sizeof(buffer));
}
else
{
- buildCmdLine2 (buffer, port->linker.mcmd, PATH_MAX);
+ buildCmdLine2 (buffer, port->linker.mcmd, sizeof(buffer));
}
system_ret = my_system (buffer);
strncpyz (scratchFileName, fullDstFileName, sizeof(scratchFileName));
} else {
/* the assembled file gets the name of the first modul */
- strncpyz (scratchFileName, dstFileName, PATH_MAX);
- strncatz (scratchFileName, port->linker.rel_ext, PATH_MAX);
+ strncpyz (scratchFileName, dstFileName, sizeof(scratchFileName));
+ strncatz (scratchFileName, port->linker.rel_ext,
+ sizeof(scratchFileName));
}
if (port->assembler.do_assemble) {
if (options.verbose)
printf ("sdcc: Calling preprocessor...\n");
- buildCmdLine2 (buffer, _preCmd, PATH_MAX);
+ buildCmdLine2 (buffer, _preCmd, sizeof(buffer));
if (my_system (buffer))
{
{
getPathDifference (buffer, PREFIX, BINDIR);
strncpyz (scratchFileName, getenv (SDCCDIR_NAME), sizeof(scratchFileName));
- strncatz (scratchFileName, buffer, PATH_MAX);
+ strncatz (scratchFileName, buffer, sizeof(scratchFileName));
setMainValue ("bindir", scratchFileName);
ExePathList[0] = Safe_strdup (scratchFileName);
}