summaryrefslogtreecommitdiff
path: root/gcc/tradcpp.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-02 18:56:37 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-02 18:56:37 +0000
commit537c4bc627b8f5319a8cf4e59ee53cf88428787a (patch)
tree955327bc9f9ac1f86814b649a8e7be4427abe84a /gcc/tradcpp.c
parent0f6b559cc1377adefe62b8ee02afea3b58120c80 (diff)
downloadgcc-537c4bc627b8f5319a8cf4e59ee53cf88428787a.tar.gz
* cpphash.h (struct spec_nodes): Remove n__CHAR_UNSIGNED__.
* cpphash.c (_cpp_init_hashtable): Similarly. * cppinit.c (cpp_create_reader): Default the signed_char flag. (init_builtins): Define __CHAR_UNSIGNED__ appropriately. (COMMAND_LINE_OPTIONS): Recognise -f{un,}signed-char. (cpp_handle_option): Handle the new options. * cpplex.c (cpp_interpret_charconst): Use new flag. * cpplib.h (struct cpp_options): New member signed_char. * gcc.c (cpp_unique_options): Remove %c spec and documentation. (cpp_options): Handle -fsigned-char and -funsigned-char. (static_specs): Remove signed_char_spec. (do_spec1): Don't handle %c. * system.h: Poison SIGNED_CHAR_SPEC. * tradcif.y (yylex): Use flag_signed_char. * tradcpp.h (flag_signed_char): New. * tradcpp.c (flag_signed_char): New. (main): Handle new command-line options. (initialize_builtins): Define __CHAR_UNSIGNED__ if appropriate. config: * alpha/alpha.h (SIGNED_CHAR_SPEC): Remove. * avr/avr.h: Remove old comments. * i960/i960.h (CPP_SPEC): Pass -fsigned-char if -mic*. (CC1_SPEC): Pass -fsigned-char if -mic*. (SIGNED_CHAR_SPEC): Remove. doc: * tm.texi (SIGNED_CHAR_SPEC): Remove documentation. testsuite: * gcc.dg/cpp/uchar-1.c, uchar-2.c, uchar-3.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49444 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tradcpp.c')
-rw-r--r--gcc/tradcpp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c
index 11c5fd3c5c0..3cff998e406 100644
--- a/gcc/tradcpp.c
+++ b/gcc/tradcpp.c
@@ -86,6 +86,13 @@ int inhibit_warnings = 0;
/* Non-0 means don't output the preprocessed program. */
int inhibit_output = 0;
+/* Nonzero means chars are signed. */
+#if DEFAULT_SIGNED_CHAR
+int flag_signed_char = 1;
+#else
+int flag_signed_char = 0;
+#endif
+
/* Nonzero means warn if slash-star appears in a comment. */
int warn_comments;
@@ -627,6 +634,10 @@ main (argc, argv)
user_label_prefix = "_";
else if (!strcmp (argv[i], "-fno-leading-underscore"))
user_label_prefix = "";
+ else if (!strcmp (argv[i], "-fsigned-char"))
+ flag_signed_char = 1;
+ else if (!strcmp (argv[i], "-funsigned-char"))
+ flag_signed_char = 0;
break;
case 'M':
@@ -5105,6 +5116,9 @@ initialize_builtins ()
#endif
install_value ("__REGISTER_PREFIX__", REGISTER_PREFIX);
install_value ("__USER_LABEL_PREFIX__", user_label_prefix);
+
+ if (flag_signed_char == 0)
+ install_value ("__CHAR_UNSIGNED__", "1");
}
#undef DSC
#undef install_spec