From 86b43436b761589f46ace3adca63dfeaf602b237 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 13 Jul 2018 10:15:52 +0000 Subject: [PATCH] lang.opt (funsigned-char): New option. * gcc-interface/lang.opt (funsigned-char): New option. * gcc-interface/misc.c (gnat_handle_option): Accept it. * gcc-interface/utils.c (finish_character_type): Tweak comment. From-SVN: r262629 --- gcc/ada/ChangeLog | 8 +++++++- gcc/ada/gcc-interface/lang.opt | 4 ++++ gcc/ada/gcc-interface/misc.c | 1 + gcc/ada/gcc-interface/utils.c | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ab7d5a178a6..6e53729ecf7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-07-13 Eric Botcazou + + * gcc-interface/lang.opt (funsigned-char): New option. + * gcc-interface/misc.c (gnat_handle_option): Accept it. + * gcc-interface/utils.c (finish_character_type): Tweak comment. + 2018-07-07 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local @@ -2351,7 +2357,7 @@ 2018-05-21 Jerome Lambourg * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build - for QNX. + for QNX. 2018-05-21 Hristian Kirtchev diff --git a/gcc/ada/gcc-interface/lang.opt b/gcc/ada/gcc-interface/lang.opt index 17c6dc84783..18ff6b0d1bd 100644 --- a/gcc/ada/gcc-interface/lang.opt +++ b/gcc/ada/gcc-interface/lang.opt @@ -80,6 +80,10 @@ fsigned-char Ada AdaWhy AdaSCIL Make \"char\" signed by default. +funsigned-char +Ada AdaWhy AdaSCIL +Make \"char\" unsigned by default. + gant Ada AdaWhy AdaSCIL Driver Joined Undocumented RejectNegative Catch typos. diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 0bcd385de72..f74dd5e9d02 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -170,6 +170,7 @@ gnat_handle_option (size_t scode, const char *arg, int value, int kind, case OPT_fshort_enums: case OPT_fsigned_char: + case OPT_funsigned_char: /* These are handled by the middle-end. */ break; diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index af85a0fe858..432bafe222c 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1684,7 +1684,7 @@ record_builtin_type (const char *name, tree type, bool artificial_p) integral types are unsigned. Unfortunately the signedness of 'char' in C is implementation-defined - and GCC even has the option -fsigned-char to toggle it at run time. + and GCC even has the option -f{un}signed-char to toggle it at run time. Since GNAT's philosophy is to be compatible with C by default, to wit Interfaces.C.char is defined as a mere copy of Character, we may need to declare character types as signed types in GENERIC and generate the -- 2.30.2