Check for sign problems in compares
git-svn-id: svn://svn.cc65.org/cc65/trunk@932 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -360,7 +360,7 @@ static int FuncStrAt (void)
|
|||||||
Index = ConstExpression ();
|
Index = ConstExpression ();
|
||||||
|
|
||||||
/* Must be a valid index */
|
/* Must be a valid index */
|
||||||
if (Index >= strlen (Str)) {
|
if (Index >= (long) strlen (Str)) {
|
||||||
Error (ERR_RANGE);
|
Error (ERR_RANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ListLine* LineLast = 0; /* Last (current) listing line */
|
|||||||
/* Page and other formatting */
|
/* Page and other formatting */
|
||||||
int PageLength = -1; /* Length of a listing page */
|
int PageLength = -1; /* Length of a listing page */
|
||||||
static unsigned PageNumber = 1; /* Current listing page number */
|
static unsigned PageNumber = 1; /* Current listing page number */
|
||||||
static unsigned PageLines = 0; /* Current line on page */
|
static int PageLines = 0; /* Current line on page */
|
||||||
static unsigned ListBytes = 12; /* Number of bytes to list for one line */
|
static unsigned ListBytes = 12; /* Number of bytes to list for one line */
|
||||||
|
|
||||||
/* Switch the listing on/off */
|
/* Switch the listing on/off */
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
};
|
};
|
||||||
|
|
||||||
int I;
|
unsigned I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (&argc, &argv, "ca65");
|
InitCmdLine (&argc, &argv, "ca65");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# Library dir
|
# Library dir
|
||||||
COMMON = ../common
|
COMMON = ../common
|
||||||
|
|
||||||
CFLAGS = -g -O2 -Wall -I$(COMMON)
|
CFLAGS = -g -O2 -Wall -Wsign-compare -I$(COMMON)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
EBIND = emxbind
|
EBIND = emxbind
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ static void FuncRight (void)
|
|||||||
List = CollectTokens (0, 9999);
|
List = CollectTokens (0, 9999);
|
||||||
|
|
||||||
/* Delete tokens from the list until Count tokens are remaining */
|
/* Delete tokens from the list until Count tokens are remaining */
|
||||||
while (List->Count > Count) {
|
while (List->Count > (unsigned) Count) {
|
||||||
/* Get the first node */
|
/* Get the first node */
|
||||||
TokNode* T = List->Root;
|
TokNode* T = List->Root;
|
||||||
|
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ Again:
|
|||||||
/* Read the number */
|
/* Read the number */
|
||||||
IVal = 0;
|
IVal = 0;
|
||||||
while (IsDigit (C)) {
|
while (IsDigit (C)) {
|
||||||
if (IVal > (0xFFFFFFFF / 10)) {
|
if (IVal > (long) (0xFFFFFFFFUL / 10)) {
|
||||||
Error (ERR_NUM_OVERFLOW);
|
Error (ERR_NUM_OVERFLOW);
|
||||||
IVal = 0;
|
IVal = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -592,7 +592,11 @@ void SymConDes (const char* Name, unsigned Type, unsigned Prio)
|
|||||||
SymEntry* S;
|
SymEntry* S;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
|
#if (CD_TYPE_MIN != 0)
|
||||||
CHECK (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
|
CHECK (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
|
||||||
|
#else
|
||||||
|
CHECK (Type <= CD_TYPE_MAX);
|
||||||
|
#endif
|
||||||
CHECK (Prio >= CD_PRIO_MIN && Prio <= CD_PRIO_MAX);
|
CHECK (Prio >= CD_PRIO_MIN && Prio <= CD_PRIO_MAX);
|
||||||
|
|
||||||
/* Don't accept local symbols */
|
/* Don't accept local symbols */
|
||||||
|
|||||||
Reference in New Issue
Block a user