rework string pooling; disable our own (rely on compiler’s)…

• if HAVE_STRING_POOLING is set to 1
• if HAVE_STRING_POOLING is set to 2 and not GCC < 4 is used
• if HAVE_STRING_POOLING is not set to 0 and LLVM or GCC >= 4 is used

Closes: LP#1580348
This commit is contained in:
tg
2016-07-25 00:04:48 +00:00
parent 816614d3ce
commit c3e794c4d0
18 changed files with 672 additions and 397 deletions

16
expr.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.85 2016/05/05 22:56:13 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.86 2016/07/25 00:04:42 tg Exp $");
/* the order of these enums is constrained by the order of opinfo[] */
enum token {
@ -274,33 +274,33 @@ evalerr(Expr_state *es, enum error_type type, const char *str)
default:
s = opinfo[(int)es->tok].name;
}
warningf(true, "%s: %s '%s'", es->expression,
"unexpected", s);
warningf(true, Tf_sD_s_qs, es->expression,
Tunexpected, s);
break;
case ET_BADLIT:
warningf(true, "%s: %s '%s'", es->expression,
warningf(true, Tf_sD_s_qs, es->expression,
"bad number", str);
break;
case ET_RECURSIVE:
warningf(true, "%s: %s '%s'", es->expression,
warningf(true, Tf_sD_s_qs, es->expression,
"expression recurses on parameter", str);
break;
case ET_LVALUE:
warningf(true, "%s: %s %s",
warningf(true, Tf_sD_s_s,
es->expression, str, "requires lvalue");
break;
case ET_RDONLY:
warningf(true, "%s: %s %s",
warningf(true, Tf_sD_s_s,
es->expression, str, "applied to read-only variable");
break;
default: /* keep gcc happy */
case ET_STR:
warningf(true, "%s: %s", es->expression, str);
warningf(true, Tf_sD_s, es->expression, str);
break;
}
unwind(LAEXPR);