From: Manuel López-Ibáñez Date: Tue, 9 Sep 2014 21:41:43 +0000 (+0000) Subject: invoke.texi (Wnormalized=): Update. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ef33fd4cd139a24524f0cd41b07ea9526dfacc5;p=gcc.git invoke.texi (Wnormalized=): Update. gcc/ChangeLog: 2014-09-09 Manuel López-Ibáñez * doc/invoke.texi (Wnormalized=): Update. libcpp/ChangeLog: 2014-09-09 Manuel López-Ibáñez * include/cpplib.h (struct cpp_options): Declare warn_normalize as int instead of enum. gcc/c-family/ChangeLog: 2014-09-09 Manuel López-Ibáñez * c.opt (Wnormalized): New. (Wnormalized=): Use Enum and Reject Negative. * c-opts.c (c_common_handle_option): Do not handle Wnormalized here. gcc/testsuite/ChangeLog: 2014-09-09 Manuel López-Ibáñez * gcc.dg/cpp/warn-normalized-3.c: Delete useless dg-prune-output. From-SVN: r215093 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a967334bc20..de1d1a9006e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-09-09 Manuel López-Ibáñez + + * doc/invoke.texi (Wnormalized=): Update. + 2014-09-09 Segher Boessenkool PR target/63195 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 7768555e473..81e253d03bd 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-09-09 Manuel López-Ibáñez + + * c.opt (Wnormalized): New. + (Wnormalized=): Use Enum and Reject Negative. + * c-opts.c (c_common_handle_option): Do not handle Wnormalized here. + 2014-09-08 Joseph Myers * c-cppbuiltin.c (c_cpp_builtins): Define macros for mantissa diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index b701022ce10..74866911e5b 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -384,29 +384,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, cpp_opts->warn_num_sign_change = value; break; - case OPT_Wnormalized_: - /* FIXME: Move all this to c.opt. */ - if (kind == DK_ERROR) - { - gcc_assert (!arg); - inform (input_location, "-Werror=normalized=: set -Wnormalized=nfc"); - cpp_opts->warn_normalize = normalized_C; - } - else - { - if (!value || (arg && strcasecmp (arg, "none") == 0)) - cpp_opts->warn_normalize = normalized_none; - else if (!arg || strcasecmp (arg, "nfkc") == 0) - cpp_opts->warn_normalize = normalized_KC; - else if (strcasecmp (arg, "id") == 0) - cpp_opts->warn_normalize = normalized_identifier_C; - else if (strcasecmp (arg, "nfc") == 0) - cpp_opts->warn_normalize = normalized_C; - else - error ("argument %qs to %<-Wnormalized%> not recognized", arg); - break; - } - case OPT_Wunknown_pragmas: /* Set to greater than 1, so that even unknown pragmas in system headers will be warned about. */ diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index d1c5c056b76..11703b92aaf 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -633,9 +633,32 @@ Wnonnull C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall) ; +Wnormalized +C ObjC C++ ObjC++ Alias(Wnormalized=,nfc,none) +; + Wnormalized= -C ObjC C++ ObjC++ Joined Warning --Wnormalized= Warn about non-normalised Unicode strings +C ObjC C++ ObjC++ RejectNegative Joined Warning CPP(warn_normalize) Init(normalized_C) Var(cpp_warn_normalize) Enum(cpp_normalize_level) +-Wnormalized= Warn about non-normalised Unicode strings + +; Required for these enum values. +SourceInclude +cpplib.h + +Enum +Name(cpp_normalize_level) Type(int) UnknownError(argument %qs to %<-Wnormalized%> not recognized) + +EnumValue +Enum(cpp_normalize_level) String(none) Value(normalized_none) + +EnumValue +Enum(cpp_normalize_level) String(nfkc) Value(normalized_KC) + +EnumValue +Enum(cpp_normalize_level) String(id) Value(normalized_identifier_C) + +EnumValue +Enum(cpp_normalize_level) String(nfc) Value(normalized_C) Wold-style-cast C++ ObjC++ Var(warn_old_style_cast) Warning diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ca9522a6016..a680be918fc 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -262,7 +262,8 @@ Objective-C and Objective-C++ Dialects}. -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces @gol -Wmissing-field-initializers -Wmissing-include-dirs @gol --Wno-multichar -Wnonnull -Wodr -Wno-overflow -Wopenmp-simd @gol +-Wno-multichar -Wnonnull -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol + -Wodr -Wno-overflow -Wopenmp-simd @gol -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol -Wpointer-arith -Wno-pointer-to-int-cast @gol @@ -4921,8 +4922,10 @@ Do not warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they indicate a typo in the user's code, as they have implementation-defined values, and should not be used in portable code. -@item -Wnormalized= +@item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]} @opindex Wnormalized= +@opindex Wnormalized +@opindex Wno-normalized @cindex NFC @cindex NFKC @cindex character set, input normalization @@ -4938,7 +4941,8 @@ have not been normalized; this option controls that warning. There are four levels of warning supported by GCC@. The default is @option{-Wnormalized=nfc}, which warns about any identifier that is not in the ISO 10646 ``C'' normalized form, @dfn{NFC}. NFC is the -recommended form for most uses. +recommended form for most uses. It is equivalent to +@option{-Wnormalized}. Unfortunately, there are some characters allowed in identifiers by ISO C and ISO C++ that, when turned into NFC, are not allowed in @@ -4949,9 +4953,10 @@ It is hoped that future versions of the standards involved will correct this, which is why this option is not the default. You can switch the warning off for all characters by writing -@option{-Wnormalized=none}. You should only do this if you -are using some other normalization scheme (like ``D''), because -otherwise you can easily create bugs that are literally impossible to see. +@option{-Wnormalized=none} or @option{-Wno-normalized}. You should +only do this if you are using some other normalization scheme (like +``D''), because otherwise you can easily create bugs that are +literally impossible to see. Some characters in ISO 10646 have distinct meanings but look identical in some fonts or display methodologies, especially once formatting has diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 448a7ef2281..0a2562ab42c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-09-09 Manuel López-Ibáñez + + * gcc.dg/cpp/warn-normalized-3.c: Delete useless dg-prune-output. + 2014-09-09 Bill Schmidt * gcc.target/powerpc/swaps-p8-15.c: Remove scan-assembler-not for diff --git a/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c b/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c index 43ea76a0e78..d6cd56f0151 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c @@ -1,5 +1,4 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Werror=normalized=" } /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ - // { dg-prune-output ".*-Werror=normalized=: set -Wnormalized=nfc.*" } \u0F43 // { dg-error "`.U00000f43' is not in NFC .-Werror=normalized=." } diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 890b7fc6897..d98611925d2 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-09 Manuel López-Ibáñez + + * include/cpplib.h (struct cpp_options): Declare warn_normalize as + int instead of enum. + 2014-09-04 Manuel López-Ibáñez * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 28cb495d425..62d271be41c 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -457,8 +457,8 @@ struct cpp_options const char *input_charset; /* The minimum permitted level of normalization before a warning - is generated. */ - enum cpp_normalize_level warn_normalize; + is generated. See enum cpp_normalize_level. */ + int warn_normalize; /* True to warn about precompiled header files we couldn't use. */ bool warn_invalid_pch;