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

110 Commits

Author SHA1 Message Date
Greg King
f11ae87ada Always put goto stack-adjustments in the RODATA segment. 2018-10-02 23:19:38 -04:00
laubzega
02a914625b Formatting fixes. 2018-10-02 18:49:53 +02:00
laubzega
2ec21c5b7f Fix non-goto jumps (i.e. inline assembly). 2018-10-02 18:49:53 +02:00
laubzega
8845e71161 Another warning. 2018-10-02 18:49:53 +02:00
laubzega
c797b3b376 Proper warnings for "risky" gotos. 2018-10-02 18:49:53 +02:00
laubzega
c835f49913 Clean-up 2018-10-02 18:49:53 +02:00
laubzega
2ac2ffcd43 Adjust SP on gotos between blocks with local variables. 2018-10-02 18:49:53 +02:00
laubzega
a48bbc4be0 Switched from warning to error. Tightened the testcase. 2018-10-02 18:49:53 +02:00
Laubzega
581c46c213 Add checks for risky goto statements. 2018-10-02 18:49:53 +02:00
Piotr Fusik
d2c89d2ba9 "static int n; int n;" is an error.
Fixes test/err/static-4.c regression.
2017-03-09 19:14:31 +01:00
Greg King
6032849e60 Added warning diagnostics for conflicts between extern/public and static declarations. 2015-08-10 13:39:17 -04:00
Greg King
4e9842ef33 Stopped extern declarations from changing previous static, but otherwise identical, declarations. 2015-08-09 06:27:05 -04:00
Spiro Trikaliotis
f4f879283d Fix for: cc65 forgetting to emit labels (Alan Cox)
Alan Cox provided this on 2014-10-02 on the cc65.org mailing list:

http://www.cc65.org/mailarchive/2014-10/11673.html
[...]
It breaks in several spots with cc65 where cc65 forgets to emit the
labels for the goto statements - the code is there but with no label
and it them blows up linking
[...]

He also provided a fix:
http://www.cc65.org/mailarchive/2014-10/11675.html

which was approved by Uz:
http://www.cc65.org/mailarchive/2014-10/11679.html

This is the patch of Alan Cox, adjusted only to the new locations on
cc65/github.
2014-10-14 13:32:58 +02:00
Greg King
0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt
4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz
fd679d92d0 Fixed a problem: When a struct or unit was declared with a tag name, it was
possible to use the opposite type with the tag name. That is "struct a" after
declaring "union a" and vice versa.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5980 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-02 22:31:26 +00:00
uz
515661e5f4 Fixed an error: For symbols declared as extern in local scope, the name for
the external assembler symbol wasn't set.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5620 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-03-24 13:42:10 +00:00
uz
8fc851b338 Write out global symbols to the debug file. Added some fixes for unusual
situations (extern symbols without attached import, because the import wasn't
referenced and therefore removed by the assembler).


git-svn-id: svn://svn.cc65.org/cc65/trunk@5290 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-31 20:48:40 +00:00
uz
b8d43cee42 Tracked rename of hashstr -> hashfunc.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5156 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-12 15:36:53 +00:00
uz
548336a7bd Renamed attribute handling functions. Added SymHasAttr().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4375 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 10:19:26 +00:00
uz
a5a9700d19 Changed handling of attributes to a more generic form (it's allowed in each
declaration now) and added a new attribute "unused" to flag unused parameters,
variables or functions that shouldn't be warned about.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4373 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-18 21:42:59 +00:00
uz
5a00b38aab Fixed the existing but unused attribute parsing code. Added
__attribute__((noexit)) that may be used to mark functions that won't return.
Added this attribute to the exit() function in stdlib.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4372 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-18 18:31:02 +00:00
uz
b55419af59 Rewrote handling of the -W command line option. It is now used to enable or
disable warnings by name.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4348 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 13:29:35 +00:00
uz
94a2223443 Use SymIsTypeDef and SymIsBitField instead of accessing Sym->Flags directly.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4123 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 16:51:08 +00:00
uz
7ced0a2ceb Rename Width to BitWidth.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4073 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 19:04:21 +00:00
uz
bd872a6324 Added code to parse bit fields and enter them into the symbol table. They're
not supported in code generation until now.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4072 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 17:38:53 +00:00
uz
63943c3f44 Test for pointer must use IsTypePtr not a direct compare. The later may (and
does) fail because of qualifiers.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3898 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-31 18:23:58 +00:00
uz
a1d7fed128 Fixed several problems with old style (K&R) declarations and a mix of old and
new style decls.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3869 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 20:55:36 +00:00
cuz
57c2e0cc0b Fixed an error handling SC_EXTERN.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3785 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-07-03 16:02:04 +00:00
cuz
de3a20a898 Changed the low level type representation from a strung of unsigned short
elements to a string of structs, each representing one type element. This
should fix problems on unusual architectures, since it is no longer necessary
to embedd pointers and other data converted to numbers in the string of
unsigned shorts.
Increased the TypeCode length to unsigned long to make room for more type
bits.
Inline more functions in datatype.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3709 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 12:29:37 +00:00
cuz
104ae3a54f Move the compiler stack pointer into its own module.
Improved the inlining of standard C functions. Added more standard functions
to inline.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3095 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-05 11:35:53 +00:00
cuz
8d8162eb23 Rewrite/cleanup of the complete expression flags handling.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3056 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-31 15:27:33 +00:00
cuz
72923eb316 Generate assembler names for symbols
git-svn-id: svn://svn.cc65.org/cc65/trunk@3048 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-26 13:44:53 +00:00
cuz
89d4ba5553 Fixed a bug - enum tags were inserted into the wrong table
git-svn-id: svn://svn.cc65.org/cc65/trunk@2484 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-10-09 18:56:38 +00:00
cuz
c123666d24 Added flexible array members for structs
git-svn-id: svn://svn.cc65.org/cc65/trunk@1925 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-02-03 22:14:20 +00:00
cuz
abcc981253 Move the Debug flag into a new module "debugflag" in the common directory.
Remove the const qualifier from the argument of xfree().


git-svn-id: svn://svn.cc65.org/cc65/trunk@1877 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-04 16:59:51 +00:00
cuz
9328da18fb Fixed symtab code
git-svn-id: svn://svn.cc65.org/cc65/trunk@1642 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-25 15:13:03 +00:00
cuz
70755921a9 Re-added register variables.
Changed/added several optimizer steps to detect register variables correctly
or to handle them in a special way.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1636 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-25 15:05:15 +00:00
cuz
ede471904c Reenable register variables
git-svn-id: svn://svn.cc65.org/cc65/trunk@1625 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-24 23:31:54 +00:00
cuz
fac003f477 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@902 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-13 15:29:59 +00:00
cuz
12ec031f9a Polishing and minor corrections
git-svn-id: svn://svn.cc65.org/cc65/trunk@741 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 13:58:56 +00:00
cuz
e6484f85c7 Working on the new backend
git-svn-id: svn://svn.cc65.org/cc65/trunk@715 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-05 13:51:42 +00:00
cuz
8eadb8aee0 Working on the new backend
git-svn-id: svn://svn.cc65.org/cc65/trunk@706 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-03 17:34:54 +00:00
cuz
9d1940a124 Working on the new backend
git-svn-id: svn://svn.cc65.org/cc65/trunk@700 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-01 09:21:32 +00:00
cuz
9cb63b679c Renamed GetLabel to GetLocalLabel
git-svn-id: svn://svn.cc65.org/cc65/trunk@692 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-04-19 06:49:08 +00:00
cuz
59bcc726b6 Make AddConstSym from AddEnumSym
git-svn-id: svn://svn.cc65.org/cc65/trunk@660 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-03-23 21:27:48 +00:00
cuz
594a941ee9 Make __fixargs__ an actual symbol table entry. Add a new pseudo variable
__argsize__.


git-svn-id: svn://svn.cc65.org/cc65/trunk@646 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-03-23 10:16:50 +00:00
cuz
cd6f591d11 Minor rearrangements to make the code more robust in case of errors.
git-svn-id: svn://svn.cc65.org/cc65/trunk@549 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-12-04 20:39:17 +00:00
cuz
d341e0ad76 Removed error numbers in favour of literal error messages. The error numbers
were harder to manage, made the code harder to read, and lead no less
verbose messages, since it was effort to add a new message. The new approach
has the drawback that it's more difficult to translate, but this won't
happen anyway.


git-svn-id: svn://svn.cc65.org/cc65/trunk@428 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-02 21:22:33 +00:00
cuz
221ef5a9c2 Error handling cleanup/changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@369 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-10-15 19:52:01 +00:00
cuz
25f5c69efa Reworked type comparison and handling of type qualifiers
git-svn-id: svn://svn.cc65.org/cc65/trunk@285 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-14 22:18:26 +00:00
cuz
85417b6d1b Some changes in the way, types and type strings are handled.
Check for and honour const in several places: Assignment to const is flagged
with an error. Const data is placed in the rodata segment.


git-svn-id: svn://svn.cc65.org/cc65/trunk@252 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-01 18:45:08 +00:00
cuz
e133416d05 Moved the check module to the common dir.
Replaced the type constants by something more expandable.


git-svn-id: svn://svn.cc65.org/cc65/trunk@248 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-01 15:04:35 +00:00
cuz
9e83b00152 Rewrote parsing of locals.
Removed non working code for register variables.


git-svn-id: svn://svn.cc65.org/cc65/trunk@96 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-22 11:28:39 +00:00
cuz
c31008c78a Remove io.*, some cleanup
git-svn-id: svn://svn.cc65.org/cc65/trunk@87 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-15 19:03:01 +00:00
cuz
aa8737733f Use the xmalloc module from the common directory.
Rewrote the include file management, keeping a list of all include files
and cleaning up the code while going.


git-svn-id: svn://svn.cc65.org/cc65/trunk@82 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-14 21:01:37 +00:00
cuz
9cc25f13b6 Added support for old style (K&R) function declarations.
Several renames for better readibility.
Removed separate struct and enum symbol tables in favour of one tag table.
Check for some more error conditions or dubious constructs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@62 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-12 18:31:40 +00:00
cuz
774b4bb424 Some work on function stuff.
Use xsprintf from the common directory.
Use hashstr from the common directory.


git-svn-id: svn://svn.cc65.org/cc65/trunk@36 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-08 20:27:05 +00:00
uz
53dd513176 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-05-28 13:40:48 +00:00