1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-12 02:30:44 +00:00

3412 Commits

Author SHA1 Message Date
Bob Andrews
d365b8a4ee Adjust comments 2022-07-21 03:22:52 +02:00
rofl0r
5867d3a020 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-07-21 03:22:52 +02:00
Bob Andrews
546e82965d Try reading from /proc/self first on linux, this is needed to make the edgy "make avail" work 2022-07-21 03:22:52 +02:00
rofl0r
6f74a2e9c7 rename AddSubSearchPathFromWinBin to AddSubSearchPathFromBin 2022-07-21 03:22:52 +02:00
rofl0r
6a5375ace4 implement AddSubSearchPathFromWinBin() counterpart for unix
this looks up paths relative to the binary used to start the
specific application.
2022-07-21 03:22:52 +02:00
rofl0r
6eeaf7485c 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-07-21 03:22:52 +02:00
rofl0r
058126ae41 remove orphaned STRINGIZE macro 2022-07-21 03:20:45 +02:00
rofl0r
910ce5c1fd 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-07-21 03:20:45 +02:00
rofl0r
09e0dd02a0 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-07-21 03:20:45 +02:00
mrdudz
7c96af75c5 const value should never have default size, use 32bit instead 2022-07-21 03:20:45 +02:00
mrdudz
501da2de2b 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-07-21 03:20:45 +02:00
mrdudz
6702b3c85e special case for evaluating the AND operator, this should fix the problems
described in issue #1538
2022-07-21 03:20:45 +02:00
mrdudz
b523d72471 more descriptive error message 2022-07-21 03:20:45 +02:00
mrdudz
964546d444 typo 2022-07-21 03:20:45 +02:00
acqn
bf7ef02fbc Added supports for long bit-fields. 2022-07-21 03:20:45 +02:00
acqn
3e614d9353 Separated data initializer stuff from declaration stuff. 2022-07-21 03:20:44 +02:00
acqn
087b7bd8c8 Optimized g_testbitfield() and g_extractbitfield() with enhanced support for long bit-fields. 2022-07-21 03:20:44 +02:00
acqn
ff1eca5701 Added and used new utility type functions for bit-fields.
Fixed GetUnderlyingTypeCode() for bit-fields with widths > 16.
2022-07-21 03:20:44 +02:00
mrdudz
78244351b7 remove dangling spaces 2022-07-21 03:20:44 +02:00
Karri Kaksonen
e653204ffe Add target atari7800 2022-07-21 03:20:44 +02:00
empathicqubit
2bd30afdeb Add --debug-tables <filename> option and output struct and union fields 2022-07-21 03:20:44 +02:00
Greg King
c6c199bd59 Added a URL to the snapshot's commit history as a comment in the Windows snapshot ZIPs. 2022-07-21 03:20:44 +02:00
nyanpasu64
aebf61464d Replace #include "inttypes.h" with <inttypes.h> 2022-07-21 03:20:44 +02:00
nyanpasu64
8afbf3f5ff Fix format strings to properly format uintptr_t 2022-07-21 03:20:44 +02:00
nyanpasu64
190e04b0ce 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-07-21 03:20:44 +02:00
nyanpasu64
b9651e4b06 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-07-21 03:20:44 +02:00
acqn
43abc5b01f Fixed signed long comparisons with smaller unsigned types. 2022-07-21 03:18:13 +02:00
acqn
f0242fb7d5 Fixed LimitExprValue() for 64-bit long env. 2022-07-21 03:18:13 +02:00
acqn
7e3aaf199a Fixed bitwise shift with numeric constant operand(s). 2022-07-21 03:18:13 +02:00
acqn
1579d2ec41 Fixed OptCmp1 with certain code patterns with labels. 2022-07-21 03:18:13 +02:00
Jeff Tranter
ba13ba32a1 Fix some commonly made spelling errors in comments. 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
77fa71994f 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-07-21 03:18:13 +02:00
Spiro Trikaliotis
e35f4fb48f 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-07-21 03:18:13 +02:00
acqn
ace0bc414b Fixed anonymous bit-fields declared with typedef'ed type names. 2022-07-21 03:18:13 +02:00
acqn
879ed5bb95 Fixed crash with labels in non-function/block scopes. 2022-07-21 03:18:13 +02:00
Greg King
800568dd58 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-07-21 03:18:13 +02:00
Greg King
3885dd8504 Removed an obsolete command-line option from the cc65 compiler. 2022-07-21 03:13:10 +02:00
Matthew D. Steele
815e30c47f Add space after function names 2022-07-21 03:13:10 +02:00
Matthew D. Steele
db02a89b5d Move local variable declaration to top of block 2022-07-21 03:13:10 +02:00
Matthew D. Steele
ceca1c496d Adjust Pop() sequencing in paravirt.c 2022-07-21 03:13:10 +02:00
Matthew D. Steele
623e951e33 Fix Pop() implementation in src/sim65/paravirt.c (fixes #1625)
The Pop() function was not handling stack pointer wrap around correctly.

Also, change the simulated RTS implementation in ParaVirtHooks() to
explicitly sequence the two Pop() calls in the correct order.
2022-07-21 03:13:10 +02:00
polluks2
7a0a0edb89 Fixed many typos 2022-07-21 03:13:09 +02:00
polluks2
5afc349199 Fixed typo 2022-07-21 03:13:09 +02:00
Greg King
81930053dd Used (size_t), instead of (long) where converting between pointers and integers.
(long) still is 32 bits on 64-bit Windows!
2022-07-21 03:13:09 +02:00
Oliver Schmidt
8b0de8a931
Merge branch 'master' into master 2021-11-23 22:56:51 +01:00
acqn
eeaa111835 Fixed crash in Opt_a_toscmpbool caused by wrong order of condition checks. 2021-09-28 17:02:37 +02:00
Greg King
fcda94f258 Made a slight improvement in the ld65 expression evaluator. 2021-06-13 20:36:05 -04:00
acqn
25a35d6b59 Fixed result type of certain operations, which was broken with the bit-field fix. 2021-06-10 21:54:32 +02:00
acqn
5adb29ce31 Made "bit-field-ness" a type property instead of a SymbolEntry or ExprDesc property.
Fixed integer promotion and result type in certain operations.
Fixed bit-fields 'op=' and postfix inc/dec operators.
2021-06-09 08:03:12 +02:00
acqn
1d7bf7355c Better function naming in declare.c.
Scalar initialization routines need only 'const Type*' as parameters.
2021-06-09 08:03:12 +02:00