summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-26 11:14:38 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-26 11:14:38 -0700
commit5b76fa26c936ae3c566ce7cb7122722b88f50d3c (patch)
treefef2a4a1d19da406843b0bec8cce672bf995d976
parentc4147f1fcc814af7ccdc761c12cbfe7c01a61948 (diff)
downloadnasm-5b76fa26c936ae3c566ce7cb7122722b88f50d3c.tar.gz
preproc.c: prevent the compiler from reducing enum pp_token_type
The compiler is free to store enum pp_token_type into any size integer small enough to contain all the values up to 2^n-1 for the smallest n which contains all the values. Force it to size it to integer size, since we use it to hold macro positional parameters.
-rw-r--r--preproc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index ab5fff7b..8598beed 100644
--- a/preproc.c
+++ b/preproc.c
@@ -158,7 +158,8 @@ enum pp_token_type {
TOK_NUMBER, TOK_FLOAT, TOK_SMAC_END, TOK_OTHER,
TOK_INTERNAL_STRING,
TOK_PREPROC_Q, TOK_PREPROC_QQ,
- TOK_SMAC_PARAM /* MUST BE LAST IN THE LIST!!! */
+ TOK_SMAC_PARAM, /* MUST BE LAST IN THE LIST!!! */
+ TOK_MAX = INT_MAX /* Keep compiler from reducing the range */
};
struct Token {