summaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-06 22:53:10 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-06 22:53:10 +0000
commit318fdd81915678cdc4e744ad9aa51cbfef2b9fc1 (patch)
tree3f56b583072218fe62c5e65ab9af8fa0eb09165a /gcc/cpplib.h
parent09b8097e4cafe3e8cd0e44f136056fce86ccad74 (diff)
downloadgcc-318fdd81915678cdc4e744ad9aa51cbfef2b9fc1.tar.gz
* c-common.c (warn_multichar): New.
(c_common_init): Set CPP's warn_multichar. * c-common.h (warn_multichar): New. * c-decl.c (warn_multichar): Remove. * c-lex.c (lex_charconst): Update. * c-tree.h (warn_multichar): Remove. * cppexp.c (eval_token): Sign-extend charconst value. * cppinit.c (cpp_create_reader): Set warn_multichar. * cpplex.c (cpp_interpret_charconst): Don't sign-extend each character. Update prototype. Sign-extend the result. * cpplib.h: Fix conditions. (struct cpp_options): Add new warning flag. (cpp_interpret_charconst): Update prototype. cp: * Make-lang.in (decl2.o): Update. * cp-tree.h (warn_multichar): Remove. * decl2.c: Include c-common.h. (warn_multichar): Remove. doc: * cpp.texi: Update documentation. testsuite: * gcc.dg/cpp/charconst-3.c: Correct tests accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53240 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 42eae9177e7..ca0eee2bd63 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -196,10 +196,10 @@ struct cpp_token
#ifndef MAX_WCHAR_TYPE_SIZE
# define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
#endif
-#if SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE
+#if CHAR_BIT * SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE
# define CPPCHAR_SIGNED_T int
#else
-# if SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG
+# if CHAR_BIT * SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG
# define CPPCHAR_SIGNED_T long
# else
# define CPPCHAR_SIGNED_T long long
@@ -329,6 +329,9 @@ struct cpp_options
/* Nonzero means warn if #import is used. */
unsigned char warn_import;
+ /* Nonzero means warn about multicharacter charconsts. */
+ unsigned char warn_multichar;
+
/* Nonzero means warn about various incompatibilities with
traditional C. */
unsigned char warn_traditional;
@@ -558,7 +561,7 @@ extern void _cpp_backup_tokens PARAMS ((cpp_reader *, unsigned int));
/* Evaluate a CPP_CHAR or CPP_WCHAR token. */
extern cppchar_t
cpp_interpret_charconst PARAMS ((cpp_reader *, const cpp_token *,
- int, unsigned int *, int *));
+ unsigned int *, int *));
/* Used to register builtins during the register_builtins callback.
The text is the same as the command line argument. */