#define OPTION_CODE_SEG "--codeseg"
#define OPTION_CONST_SEG "--constseg"
#define OPTION_DOLLARS_IN_IDENT "--fdollars-in-identifiers"
+#define OPTION_UNSIGNED_CHAR "--funsigned-char"
static const OPTION
optionsTable[] = {
{ 0, OPTION_STD_C99, NULL, "Use C99 standard only (incomplete)" },
{ 0, OPTION_STD_SDCC99, NULL, "Use C99 standard with SDCC extensions (incomplete)" },
{ 0, OPTION_DOLLARS_IN_IDENT, &options.dollars_in_ident, "Permit '$' as an identifier character" },
+ { 0, OPTION_UNSIGNED_CHAR, &options.unsigned_char, "Make \"char\" unsigned by default" },
{ 0, NULL, NULL, "Code generation options"},
{ 'm', NULL, NULL, "Set the port to use e.g. -mz80." },
/* otherwise depending on the file type */
extp = dbuf_c_str (&ext);
- if (extp[1] == '\0' && (extp[0] == 'c' || extp[0] == 'C'))
+ if (STRCASECMP (extp, ".c") == 0)
{
- unsigned char *p;
+ char *p;
dbuf_destroy (&ext);
moduleName = dbuf_detach (&ext);
for (p = moduleName; *p; ++p)
- if (!isalnum(*p))
+ if (!isalnum ((unsigned char)*p))
*p = '_';
return;
}
/* if the extention is type .rel or .r or .REL or .R
additional object file will be passed to the linker */
- if ((extp[1] == '\0' && (extp[0] == 'r' || extp[0] == 'R')) ||
- strcmp (extp, "rel") == 0 || strcmp (extp, "REL") == 0 ||
+ if (STRCASECMP (extp, ".r") == 0 || STRCASECMP (extp, ".rel") == 0 ||
strcmp (extp, port->linker.rel_ext) == 0)
{
dbuf_destroy (&ext);
}
/* if .lib or .LIB */
- if (strcmp (extp, "lib") == 0 || strcmp (extp, ".LIB") == 0)
+ if (STRCASECMP (extp, ".lib") == 0)
{
dbuf_destroy (&ext);
dbuf_destroy (&path);
{
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);