Commit Graph

8 Commits

Author SHA1 Message Date
ISSOtm
ab9307ac61 Clean up symbol management
Stop using that bitfield for everything, including what can be determined otherwise
It also makes it easier to have a sane state, since some bits were (supposedly)
mutually exclusive
2020-01-24 02:51:48 +01:00
ISSOtm
d6a99981d6 Fix checkcodebase warnings 2020-01-16 22:31:24 +01:00
ISSOtm
86a28e8201 Provide string arguments to errors in constexpr_BankSection
How the f did it work before
2020-01-13 15:13:19 +01:00
ISSOtm
23ab245cec Return a consistent number for const BANK() when erroring out 2020-01-12 13:07:48 +01:00
ISSOtm
b49e025703 Allow BANK() in constexpr expressions 2019-12-07 23:43:02 +01:00
ISSOtm
191ee4ba1f Add support for toggleable warnings 2019-11-18 20:45:21 +01:00
dbrotz
ca6149abcf Fix signed integer overflow issues
It seemed that the consensus in our discussions of signed integer
overflow, which invokes undefined behavior in C, was that integer
arithmetic should be two's complement and there should be no warning for
overflows. I have implemented that by converting values to unsigned types
when appropriate. These changes will mostly preserve existing behavior,
except for a few cases that were being handled incorrectly before.

The case of dividing INT_MIN by -1 previously resulted in a CPU
exception and program termination. Now, that case is detected and results
in a warning and a value of INT_MIN.

Similarly, INT_MIN % -1 would have resulted in a CPU exception. Since this
is a mathematically valid operation with a result of 0, it now simply
gives that result without a warning.

I noticed that in rpn.c, there were attempts in certain operation handlers
to validate the nVal members of the source expressions even when the
expressions may have been relocatable expressions with meaningless numbers
for the nVal member. This could have caused spurious errors/warnings, so I
made those handlers confirm that isReloc is false before validating nVal.

Also, integer constants that are too large now result in a warning. The
post-conversion values have not been changed, in order to preserve
backward compatibility.
2019-07-04 16:27:31 -07:00
dbrotz
3806eb3139 Fix ambiguity in const parsing 2018-12-02 13:49:12 -08:00