diff --git a/doc/cc65.sgml b/doc/cc65.sgml
index 56a87ae72..004061518 100644
--- a/doc/cc65.sgml
+++ b/doc/cc65.sgml
@@ -1391,9 +1391,9 @@ parameter with the operator will be used
+ is "bank", then ca65's function will be used
to determine the number from the bank attribute defined in the linker config,
- see . Note that
+ see . Note that
this currently implies that only the least significant 8 bits of the bank attribute
can be used.
diff --git a/doc/funcref.sgml b/doc/funcref.sgml
index 3b3db2e09..4d1a278b0 100644
--- a/doc/funcref.sgml
+++ b/doc/funcref.sgml
@@ -5186,7 +5186,7 @@ the module just loaded. Possible error codes are:
-
-
- The linker is needed to create
+
- The is needed to create
relocatable o65 modules for use with this function.
- The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
diff --git a/libsrc/telestrat/syschdir.s b/libsrc/telestrat/syschdir.s
index 149957215..09763bdbb 100644
--- a/libsrc/telestrat/syschdir.s
+++ b/libsrc/telestrat/syschdir.s
@@ -21,7 +21,7 @@ __syschdir:
; Get name
jsr popax
-
+
stx tmp1
ldy tmp1
diff --git a/src/cc65/codeent.h b/src/cc65/codeent.h
index bd542cc4c..ee1dd0220 100644
--- a/src/cc65/codeent.h
+++ b/src/cc65/codeent.h
@@ -184,7 +184,7 @@ INLINE CodeLabel* CE_GetLabel (CodeEntry* E, unsigned Index)
INLINE void CE_ReplaceLabel (CodeEntry* E, CodeLabel* L, unsigned Index)
/* Replace the code label at the specified index with L */
{
- return CollReplace (&E->Labels, L, Index);
+ CollReplace (&E->Labels, L, Index);
}
#else
# define CE_ReplaceLabel(E, L, Index) CollReplace (&(E)->Labels, (L), (Index))
diff --git a/src/cc65/codeoptutil.c b/src/cc65/codeoptutil.c
index 23c759fd1..16c41162a 100644
--- a/src/cc65/codeoptutil.c
+++ b/src/cc65/codeoptutil.c
@@ -1447,7 +1447,7 @@ void AdjustEntryIndices (Collection* Indices, int Index, int Change)
} else if (Index <= *IndexPtr) {
/* Has been removed */
*IndexPtr = -1;
- //CollDelete (Indices, I);
+ /*CollDelete (Indices, I);*/
--I;
}
}
diff --git a/src/cc65/compile.c b/src/cc65/compile.c
index f970edef7..94dfc3ffb 100644
--- a/src/cc65/compile.c
+++ b/src/cc65/compile.c
@@ -156,9 +156,8 @@ static void Parse (void)
**
** This means that "extern int i;" will not get storage allocated.
*/
- if ((Decl.StorageClass & SC_FUNC) != SC_FUNC &&
- (Decl.StorageClass & SC_TYPEMASK) != SC_TYPEDEF &&
- (Decl.StorageClass & SC_FICTITIOUS) != SC_FICTITIOUS) {
+ if ((Decl.StorageClass & SC_FUNC) != SC_FUNC &&
+ (Decl.StorageClass & SC_TYPEMASK) != SC_TYPEDEF) {
if ((Spec.Flags & DS_DEF_STORAGE) != 0 ||
(Decl.StorageClass & (SC_EXTERN|SC_STATIC)) == SC_STATIC ||
((Decl.StorageClass & SC_EXTERN) != 0 &&
diff --git a/src/cc65/datatype.c b/src/cc65/datatype.c
index 9e52027ce..90bf892ba 100644
--- a/src/cc65/datatype.c
+++ b/src/cc65/datatype.c
@@ -1242,7 +1242,7 @@ const Type* GetBaseElementType (const Type* T)
-SymEntry* GetESUSymEntry (const Type* T)
+struct SymEntry* GetESUSymEntry (const Type* T)
/* Return a SymEntry pointer from an enum/struct/union type */
{
/* Only enums, structs or unions have a SymEntry attribute */
@@ -1254,7 +1254,7 @@ SymEntry* GetESUSymEntry (const Type* T)
-void SetESUSymEntry (Type* T, SymEntry* S)
+void SetESUSymEntry (Type* T, struct SymEntry* S)
/* Set the SymEntry pointer for an enum/struct/union type */
{
/* Only enums, structs or unions have a SymEntry attribute */
diff --git a/src/cc65/datatype.h b/src/cc65/datatype.h
index 1140ee498..af1c6b8e4 100644
--- a/src/cc65/datatype.h
+++ b/src/cc65/datatype.h
@@ -45,6 +45,9 @@
#include "inline.h"
#include "mmodel.h"
+/* cc65 */
+#include "funcdesc.h"
+
/*****************************************************************************/
@@ -53,8 +56,8 @@
-typedef struct FuncDesc FuncDesc;
-typedef struct SymEntry SymEntry;
+struct StrBuf;
+struct SymEntry;
@@ -162,12 +165,12 @@ typedef unsigned long TypeCode;
/* Type entry */
typedef struct Type Type;
struct Type {
- TypeCode C; /* Code for this entry */
+ TypeCode C; /* Code for this entry */
union {
- FuncDesc* F; /* Function description pointer */
- SymEntry* S; /* Enum/struct/union tag symbol entry pointer */
- long L; /* Numeric attribute value */
- unsigned long U; /* Dito, unsigned */
+ struct FuncDesc* F; /* Function description pointer */
+ struct SymEntry* S; /* Enum/struct/union tag symbol entry pointer */
+ long L; /* Numeric attribute value */
+ unsigned long U; /* Dito, unsigned */
} A; /* Type attribute if necessary */
};
@@ -221,11 +224,6 @@ extern const Type type_c_char_p[];
extern const Type type_void_p[];
extern const Type type_c_void_p[];
-/* Forward for the SymEntry struct */
-struct SymEntry;
-
-/* Forward for the StrBuf struct */
-struct StrBuf;
/*****************************************************************************/
@@ -849,7 +847,7 @@ int IsVariadicFunc (const Type* T) attribute ((const));
*/
int IsFastcallFunc (const Type* T) attribute ((const));
-/* Return true if this is a function type or pointer to function type by
+/* Return true if this is a function type or pointer to function type with
** __fastcall__ calling convention.
** Check fails if the type is not a function or a pointer to function.
*/
diff --git a/src/cc65/declare.c b/src/cc65/declare.c
index 8879c46d8..a18c837b9 100644
--- a/src/cc65/declare.c
+++ b/src/cc65/declare.c
@@ -2080,7 +2080,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode)
if (PrevErrorCount != ErrorCount) {
/* Make the declaration fictitious if is is not parsed correctly */
- D->StorageClass |= SC_DECL | SC_FICTITIOUS;
+ D->StorageClass |= SC_FICTITIOUS;
if (Mode == DM_NEED_IDENT && D->Ident[0] == '\0') {
/* Use a fictitious name for the identifier if it is missing */
diff --git a/src/cc65/expr.c b/src/cc65/expr.c
index 01bebf18e..a63214f49 100644
--- a/src/cc65/expr.c
+++ b/src/cc65/expr.c
@@ -1301,6 +1301,7 @@ static void Primary (ExprDesc* E)
/* Statement block */
NextToken ();
Error ("Expression expected");
+ E->Flags |= E_EVAL_MAYBE_UNUSED;
hie0 (E);
if (CurTok.Tok == TOK_RCURLY) {
NextToken ();
@@ -1332,6 +1333,7 @@ static void Primary (ExprDesc* E)
}
} else {
Error ("Expression expected");
+ E->Flags |= E_EVAL_MAYBE_UNUSED;
NextToken ();
}
}
diff --git a/src/cc65/locals.c b/src/cc65/locals.c
index 7812acebd..c2e314485 100644
--- a/src/cc65/locals.c
+++ b/src/cc65/locals.c
@@ -476,8 +476,7 @@ static void ParseOneDecl (const DeclSpec* Spec)
}
/* If the symbol is not marked as external, it will be defined now */
- if ((Decl.StorageClass & SC_FICTITIOUS) == 0 &&
- (Decl.StorageClass & SC_DECL) == 0 &&
+ if ((Decl.StorageClass & SC_DECL) == 0 &&
(Decl.StorageClass & SC_EXTERN) == 0) {
Decl.StorageClass |= SC_DEF;
}
diff --git a/test/val/bug1397.c b/test/val/bug1397.c
index 4f8fb8697..191093efa 100644
--- a/test/val/bug1397.c
+++ b/test/val/bug1397.c
@@ -7,49 +7,48 @@ unsigned char c;
int *p;
void f1(void) {
- int i = 1;
- int *pa = (int *)0xaaaa;
- int *pb = (int *)0xbbbb;
+ int i = 1;
+ int *pa = (int *)0xaaaa;
+ int *pb = (int *)0xbbbb;
- p = (i == 0) ? pa : pb;
- c = 0x5a;
+ p = (i == 0) ? pa : pb;
+ c = 0x5a;
}
struct data_t {
- unsigned char c;
- int *p;
+ unsigned char c;
+ int *p;
};
struct data_t data;
void f2(void) {
- int i = 1;
- int *pa = (int *)0xcccc;
- int *pb = (int *)0xdddd;
- struct data_t *po = &data;
-
- po->p = (i == 0) ? pa : pb;
- po->c = 0xa5;
+ int i = 1;
+ int *pa = (int *)0xcccc;
+ int *pb = (int *)0xdddd;
+ struct data_t *po = &data;
+
+ po->p = (i == 0) ? pa : pb;
+ po->c = 0xa5;
}
int ret = 0;
int main(void) {
- f1();
+ f1();
if (c != 0x5a) {
ret++;
}
- printf("c: %hhx\n", c);
- printf("p: %p\n", p);
- f2();
+ printf("c: %hhx\n", c);
+ printf("p: %p\n", p);
+ f2();
if (data.c != 0xa5) {
ret++;
}
- printf("c: %hhx\n", data.c);
- printf("p: %p\n", data.p);
+ printf("c: %hhx\n", data.c);
+ printf("p: %p\n", data.p);
- printf("failures: %d\n", ret);
+ printf("failures: %d\n", ret);
return ret;
}
-
diff --git a/test/val/bug1451.c b/test/val/bug1451.c
index c00f19903..f9cca2561 100644
--- a/test/val/bug1451.c
+++ b/test/val/bug1451.c
@@ -15,7 +15,7 @@ int main(void)
S b = {1, 4};
S m[1] = {{6, 3}};
S *p = &a;
-
+
(&a)->a += b.a;
p->b += b.b;
m->a += b.a;