aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.phys.columbia.edu>1998-10-11 00:05:11 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-10 18:05:11 -0600
commitfaa765969fa9ce85b27bd20d9a966b0cabba5cdb (patch)
tree2f9de21a1e1e04335878526769ff5fd361b7abd4 /gcc/cpplib.c
parent9265dacf25a26ef02473949bc8feec743e1e5b8c (diff)
downloadgcc-faa765969fa9ce85b27bd20d9a966b0cabba5cdb.zip
gcc-faa765969fa9ce85b27bd20d9a966b0cabba5cdb.tar.gz
gcc-faa765969fa9ce85b27bd20d9a966b0cabba5cdb.tar.bz2
cppexp.c: When forcing unsigned comparisons, cast both sides of the operation.
* cppexp.c: When forcing unsigned comparisons, cast both sides of the operation. * cpphash.h: Move static declaration of hashtab[]... * cpphash.c: ...here. * cpplib.c: Cast difference of two pointers to size_t before comparing it to size_t. Cast signed to unsigned before comparing to size_t. (FIXME: struct argdata should use unsigned buffer sizes.) * cpplib.h (struct cpp_reader): Declare token_buffer_size as unsigned int. (CPP_WRITTEN): Cast return value to size_t. (CPP_RESERVE): Parenthesize N for evaluation order, cast to size_t before comparison. From-SVN: r22980
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index da2f54a..b56790e 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1512,7 +1512,7 @@ create_definition (buf, limit, pfile, predefinition)
while (is_idchar[*bp]) {
bp++;
/* do we have a "special" rest-args extension here? */
- if (limit - bp > REST_EXTENSION_LENGTH
+ if ((size_t)(limit - bp) > REST_EXTENSION_LENGTH
&& strncmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0) {
rest_args = 1;
temp->rest_args = 1;
@@ -2747,7 +2747,7 @@ macroexpand (pfile, hp)
one space except within an string or char token.*/
if (is_space[c])
{
- if (CPP_WRITTEN (pfile) > arg->stringified
+ if (CPP_WRITTEN (pfile) > (unsigned)arg->stringified
&& (CPP_PWRITTEN (pfile))[-1] == '@')
{
/* "@ " escape markers are removed */
@@ -5528,7 +5528,7 @@ open_include_file (pfile, filename, searchptr)
p = filename;
if (searchptr
&& searchptr->fname
- && strlen (searchptr->fname) == p - filename
+ && strlen (searchptr->fname) == (size_t) (p - filename)
&& ! strncmp (searchptr->fname, filename, p - filename))
{
/* FILENAME is in SEARCHPTR, which we've already checked. */