1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 19:29:53 +00:00
Commit Graph

3430 Commits

Author SHA1 Message Date
acqn
924fcf5d06 Replaced several occurance of PtrConversion() with StdConversion().
Variadic arguments of functions should be default-promoted.
2021-06-08 09:32:58 +08:00
acqn
e9545d68ee Minor clean-ups and typo fixes. 2021-04-17 11:43:03 +08:00
acqn
fdded33097 Made it easier to support 0-size structs in the future. 2020-08-15 06:27:11 +08:00
rofl0r
94e7b11870 cl65: fix regression in --print-target-path
since the "empty prefix means run from current dir" hack was removed,
cl65 --print-target-path no longer prints the path relative to the
binary, but the hardcoded library path which points to prefix, because
the code adds the hardcoded path first to the pathsearch, but then actually
only returns the first entry rather than looking whether the path exists.

closes #1754
2022-05-30 12:22:02 +00:00
Greg King
93e94c8dea Fixed a multi-line comment.
The left border is thicker in cc65 than it is in VICE.
2022-05-18 05:09:48 -04:00
compyx
2fdb1e6b0d Fix set but unused variable 2022-05-17 10:05:25 +02:00
mrdudz
f67fb3b326 define __CC65__ as ((VER_MAJOR * 0x100) + VER_MINOR), fixes issue #1667 2022-05-10 01:12:13 +02:00
mrdudz
b6ffa4af64 Fix endless loop on expanding a recursive macro, fixed issue #1678, patch by kugelfuhr 2022-05-09 21:26:45 +02:00
mrdudz
43af562ce1 At the end of the optimizer run, remove jump cascades again. fixes the
regression reported in #1652
2022-05-08 13:22:10 +02:00
mrdudz
5813fd81d3 add extra optimizer step that replaces BRA by JMP if the target is external 2022-05-08 13:20:18 +02:00
Bob Andrews
71cec58d86
Adjust comments 2022-05-05 14:24:02 +02:00
rofl0r
20dd6fd872 change GetProgPath() to return full & resolved binary path
GetProgPath() now resolves the path derived from argv[0] always
via realpath(3p) to its real location in the filesystem, and returns
the path including binary name, effectively making it work like
windows' GetModuleFileName(), so we can re-use the existing code
to strip the trailing binary name.
since symlinks are now always resolved, we no longer need the
special case code for linux to use /proc/self/exe for this purpose.
2022-05-02 08:22:21 +00:00
Bob Andrews
74f92564c3
Try reading from /proc/self first on linux, this is needed to make the edgy "make avail" work 2022-04-30 15:01:58 +02:00
rofl0r
d78672a4b4 rename AddSubSearchPathFromWinBin to AddSubSearchPathFromBin 2022-04-28 18:35:05 +00:00
rofl0r
b32c12dd83 implement AddSubSearchPathFromWinBin() counterpart for unix
this looks up paths relative to the binary used to start the
specific application.
2022-04-28 18:35:05 +00:00
rofl0r
8669710c0f build: allow empty prefix
there was some concern that this will break windows' way of doing
file lookups relatively from the binary, rather than via hardcoded
locations, but so far each occurence adding e.g. "CA65_INC" to
the pathsearch is already shielded with an #ifndef _WIN32.

addressing #1726
2022-04-27 16:19:06 +00:00
mrdudz
7c7c5af59f Merge remote-tracking branch 'upstream/master' into constexpr 2022-04-26 16:43:10 +02:00
rofl0r
13081e0989 remove orphaned STRINGIZE macro 2022-04-25 17:12:09 +00:00
rofl0r
bf1ef6157c build: properly quote strings passed as cpp macros
until now, the strings intended to be hardcoded into the binary,
such as directory names and build id, were passed unquoted, which
means they're interpreted by the preprocessor as C tokens, rather
than strings, which can result in all sorts of "interesting"
behaviour such as interpreting paths starting with // as C++-style
comment.
this was then worked around using a stringize macro which turned
the tokens into a string (if they happened to be in a compatible
format).

adresses #1726
2022-04-25 16:52:46 +00:00
rofl0r
d8482fbd57 build: allow the user to specify make V=1 for verbose build
it's often required to see the full commandline when things go wrong.
the standard way for Makefile-only based buildsystems and autoconf
is to pass V=1 to make.
2022-04-25 14:58:38 +00:00
mrdudz
23831f08de const value should never have default size, use 32bit instead 2022-04-21 14:50:48 +02:00
mrdudz
a0280d4917 Also handle the case when the non constant side of the AND expression is
known to have a smaller size than the constant side of the expression.
2022-04-20 12:53:34 +02:00
mrdudz
f64bf76ae8 special case for evaluating the AND operator, this should fix the problems
described in issue #1538
2022-04-20 00:13:34 +02:00
mrdudz
8d0098b818 more descriptive error message 2022-04-20 00:12:03 +02:00
mrdudz
89fcb0d404 typo 2022-04-20 00:11:24 +02:00
acqn
4f4487cb03 Added supports for long bit-fields. 2022-01-04 18:23:04 +08:00
acqn
21858b52e7 Separated data initializer stuff from declaration stuff. 2022-01-03 13:10:32 +08:00
acqn
970607cde5 Optimized g_testbitfield() and g_extractbitfield() with enhanced support for long bit-fields. 2021-12-05 12:21:01 +08:00
acqn
2d96f79bc7 Added and used new utility type functions for bit-fields.
Fixed GetUnderlyingTypeCode() for bit-fields with widths > 16.
2021-12-01 09:45:17 +08:00
mrdudz
3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
Bob Andrews
4cf7db1ef5
Merge pull request #1692 from karrika/atari7800
#805 Atari7800 target
2022-03-20 20:39:36 +01:00
Bob Andrews
58de94edd4
Merge pull request #1560 from empathicqubit/master
Add --debug-tables <filename> option and output struct fields
2022-03-20 20:27:15 +01:00
Greg King
b2ae73879b Added a URL to the snapshot's commit history as a comment in the Windows snapshot ZIPs. 2022-03-12 01:35:33 -05:00
nyanpasu64
9cb81f1410 Replace #include "inttypes.h" with <inttypes.h> 2022-03-06 14:48:51 -08:00
nyanpasu64
3466abc60c Fix format strings to properly format uintptr_t 2022-03-06 14:48:03 -08:00
nyanpasu64
2feba69622 Remove broken inttypes.h
src/common/inttypes.h is a shim to fix building cc65 on
non-C99-compliant compilers missing inttypes.h (like VS2012 and
earlier). The shim is actually incomplete and does not define the PRI...
macros supplied by the actual compiler headers. Since we're planning to
use those macros, delete this header so cc65's source files instead use
host-supplied inttypes.h containing macro definitions.
2022-03-06 14:47:58 -08:00
nyanpasu64
f36b9b544d Fix segfault on 64-bit LLP64 Windows builds
There are many occurrences of unsigned long in codegen.h's function
arguments. Changing g_getimmed and g_defdata makes `make` succeed
without segfaulting. I don't know if it makes cc65 behave correctly in
all cases, or if there are more unsigned long that need to be changed.
2022-03-06 14:47:51 -08:00
Karri Kaksonen
786b4310d0
Merge branch 'cc65:master' into atari7800 2022-03-05 19:09:05 +02:00
acqn
c8956ce19b Fixed signed long comparisons with smaller unsigned types. 2022-03-03 20:24:14 +08:00
Bob Andrews
0587d9f5d4
Merge pull request #1675 from acqn/ShiftFix
[cc65] Fixed bitwise shift with numeric constant operand(s)
2022-03-01 19:50:21 +01:00
Karri Kaksonen
3266e70de4 Add target atari7800 2022-03-01 06:44:55 +02:00
acqn
5ef420af5a Fixed OptCmp1 with certain code patterns with labels. 2022-03-01 10:40:01 +08:00
Jeff Tranter
2bf8be5b3b Fix some commonly made spelling errors in comments. 2022-02-21 15:44:31 -05:00
acqn
2bda128ef1 Fixed LimitExprValue() for 64-bit long env. 2022-02-26 23:02:51 +08:00
acqn
14988f5dda Fixed bitwise shift with numeric constant operand(s). 2022-02-16 20:10:54 +08:00
Spiro Trikaliotis
364e72921c ca65: .constructor after .export fails
The actor directives (.constructor, .destructor, .interruptor, and .condes)
can't handle a symbol that's already exported.

The relevant code does the checks in the wrong order.

For example, the following correct snippet does not assemble:

        .export         C
C:      .constructor    C, 5

The assembler outputs: test.s:2: Error: Address size mismatch for symbol 'C'

Exchanging both lines makes it work.

This fixes #1647; the patch is provided by 'kugelfuhr' and taken from there.
2022-02-15 22:03:47 +01:00
Spiro Trikaliotis
3d0013ab30 Invalid flagged errors if token is missing
A missing factor in an expression causes an expected but missing token
to be skipped, leading to invalid flagged errors in the following line:

l = 3 +
lda     #$00

An error should be output for line 1, but not for line 2. Actually, both
are flagged as errors:

test.s(1): Error: Syntax error
test.s(2): Error: Unexpected trailing garbage characters

This patch (as proposed in issue #1634 by kugelfuhr) fixes this.
2022-02-15 21:46:07 +01:00
Bob Andrews
24c8de87c2
Merge pull request #1662 from acqn/StructFix
[cc65] Fixed ICE on unnamed bit-fields declared with typedef'ed types
2022-02-14 17:31:45 +01:00
Greg King
86b6514c16 Added code that avoids infinite loops that were caused by circular references
(a symbol that was defined by referring to itself directly or indirectly).  Patch by kugelfuhr.
2022-02-13 07:38:00 -05:00
Greg King
112e216e53 Removed an obsolete command-line option from the cc65 compiler. 2022-01-30 22:10:06 -05:00