ic = cpplib_bufPeek (cppReader_getBufferSafe (pfile));
c = (char) ic;
- llassert (c != '#');
+
+ if (c == '#')
+ {
+ /* was: llassert (c != '#'); - Solaris uses this, attempt to continue anyway... */
+ cppReader_pedwarn (pfile,
+ message ("non-standard pre-processor directive: %c", c));
+ }
+
DPRINTF (("Read: %c", c));
if (c == '\n')
if (c != '\'')
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("malformatted character constant"));
+ cstring_makeLiteralTemp ("malformatted character constant"));
else if (num_chars == 0)
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("empty character constant"));
+ cstring_makeLiteralTemp ("empty character constant"));
else if (num_chars > max_chars)
{
num_chars = max_chars;
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("character constant too long"));
+ cstring_makeLiteralTemp ("character constant too long"));
}
else if (num_chars != 1 && ! cppReader_isTraditional (pfile))
{
cppReader_warningLit (pfile,
- cstring_makeLiteralTemp ("multi-character character constant"));
+ cstring_makeLiteralTemp ("multi-character character constant"));
}
else
{
if (toktab->token == CPPREADER_ERRORTOK)
{
- cppReader_error (pfile, message ("`%s' not allowed in operand of `#if'", cstring_fromChars (tok_start)));
+ cppReader_error (pfile,
+ message ("`%s' not allowed in operand of `#if'",
+ cstring_fromChars (tok_start)));
}
op.op = toktab->token;
if ((top->flags & HAVE_VALUE) != 0)
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error in #if"));
+ cstring_makeLiteralTemp ("syntax error in #if"));
goto syntax_error;
}
top->flags |= HAVE_VALUE;
while (top->rprio > lprio)
{
/*@-usedef@*/
- long v1 = top[-1].value, v2 = top[0].value;
+ HOST_WIDE_INT v1 = top[-1].value;
+ HOST_WIDE_INT v2 = top[0].value;
bool unsigned1 = top[-1].unsignedp;
bool unsigned2 = top[0].unsignedp;
&& ((top[0].flags & HAVE_VALUE) == 0))
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error - missing left operand"));
+ cstring_makeLiteralTemp ("syntax error - missing left operand"));
goto syntax_error;
}
if (((top[1].flags & RIGHT_OPERAND_REQUIRED) != 0)
&& ((top[1].flags & HAVE_VALUE) == 0))
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error - missing right operand"));
+ cstring_makeLiteralTemp ("syntax error - missing right operand"));
goto syntax_error;
}
/* top[0].value = (top[1].op)(v1, v2);*/
if (v2 == 0)
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("Division by zero in #if"));
+ cstring_makeLiteralTemp ("Division by zero in #if"));
v2 = 1;
}
top->unsignedp = unsigned1 || unsigned2;
if (v2 == 0)
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("Division by zero in #if"));
+ cstring_makeLiteralTemp ("Division by zero in #if"));
v2 = 1;
}
top->unsignedp = unsigned1 || unsigned2;
if ((top->flags & HAVE_VALUE) != 0)
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error"));
+ cstring_makeLiteralTemp ("syntax error"));
goto syntax_error;
}
top->value = ~ v2;
/*@switchbreak@*/ break;
case '(': case '?':
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error in #if"));
+ cstring_makeLiteralTemp ("syntax error in #if"));
goto syntax_error;
case ':':
if (top[0].op != '?')
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("syntax error ':' without preceding '?'"));
+ cstring_makeLiteralTemp ("syntax error ':' without preceding '?'"));
goto syntax_error;
}
else if (((top[1].flags & HAVE_VALUE) == 0)
|| ((top[0].flags & HAVE_VALUE) == 0))
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("bad syntax for ?: operator"));
+ cstring_makeLiteralTemp ("bad syntax for ?: operator"));
goto syntax_error;
}
else
|| ((top[-1].flags & HAVE_VALUE) != 0))
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("mismatched parentheses in #if"));
+ cstring_makeLiteralTemp ("mismatched parentheses in #if"));
goto syntax_error;
}
else
if (top != stack)
{
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("internal error in #if expression"));
+ cstring_makeLiteralTemp ("internal error in #if expression"));
}
val = top->value;
if (top == limit)
{
struct operation *new_stack;
- int old_size = (char *) limit - (char *) stack;
- size_t new_size = size_fromInt (2 * old_size);
+ size_t old_size = size_fromInt ((char *) limit - (char *) stack);
+ size_t new_size = 2 * old_size;
if (stack != init_stack)
{