From 9e637a26797c8ffa178974764874683f12b12d4d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 9 Nov 2004 10:13:30 +0000 Subject: [PATCH] builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337 --- gcc/ChangeLog | 21 ++++ gcc/ada/ChangeLog | 5 + gcc/ada/misc.c | 2 +- gcc/builtins.c | 6 +- gcc/c-common.c | 6 +- gcc/c-decl.c | 6 +- gcc/c-format.c | 4 +- gcc/c-format.h | 6 +- gcc/c-parse.in | 2 +- gcc/c-pch.c | 26 ++--- gcc/c-pragma.c | 2 +- gcc/collect2.c | 6 +- gcc/config/alpha/alpha.c | 14 +-- gcc/config/arc/arc.c | 4 +- gcc/config/arm/arm.c | 8 +- gcc/config/avr/avr.c | 6 +- gcc/config/c4x/c4x.c | 2 +- gcc/config/darwin.c | 2 +- gcc/config/frv/frv.c | 6 +- gcc/config/h8300/h8300.c | 6 +- gcc/config/i386/i386.c | 20 ++-- gcc/config/i386/winnt.c | 4 +- gcc/config/ia64/ia64.c | 4 +- gcc/config/ip2k/ip2k.c | 4 +- gcc/config/iq2000/iq2000.c | 2 +- gcc/config/m32r/m32r.c | 2 +- gcc/config/m68hc11/m68hc11.c | 8 +- gcc/config/m68k/m68k.c | 2 +- gcc/config/m68k/m68k.h | 4 +- gcc/config/mcore/mcore.c | 4 +- gcc/config/mips/mips.c | 2 +- gcc/config/mmix/mmix.c | 2 +- gcc/config/ns32k/ns32k.c | 2 +- gcc/config/rs6000/host-darwin.c | 2 +- gcc/config/rs6000/rs6000.c | 16 +-- gcc/config/s390/s390.c | 4 +- gcc/config/sh/sh.c | 16 +-- gcc/config/sh/symbian.c | 8 +- gcc/config/stormy16/stormy16.c | 12 +- gcc/config/v850/v850.c | 2 +- gcc/cp/ChangeLog | 10 ++ gcc/cp/call.c | 2 +- gcc/cp/class.c | 2 +- gcc/cp/decl.c | 6 +- gcc/cp/decl2.c | 4 +- gcc/cp/error.c | 4 +- gcc/cp/mangle.c | 4 +- gcc/cp/parser.c | 6 +- gcc/cp/pt.c | 4 +- gcc/cp/search.c | 2 +- gcc/cp/semantics.c | 8 +- gcc/cp/typeck.c | 10 +- gcc/final.c | 4 +- gcc/gcc.c | 62 +++++------ gcc/gcov.c | 30 ++--- gcc/objc/ChangeLog | 4 + gcc/objc/objc-act.c | 130 +++++++++++----------- gcc/opts.c | 2 +- gcc/pretty-print.h | 2 +- gcc/protoize.c | 90 +++++++-------- gcc/reg-stack.c | 2 +- gcc/rtl.c | 8 +- gcc/testsuite/ChangeLog | 4 + gcc/testsuite/gcc.dg/builtin-prefetch-1.c | 12 +- gcc/tlink.c | 4 +- 65 files changed, 360 insertions(+), 316 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a87c1c15c0..2fbd2a29525 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2004-11-09 Joseph S. Myers + + * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, + c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, + gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, + tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, + config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, + config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, + config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, + config/iq2000/iq2000.c, config/m32r/m32r.c, + config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, + config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, + config/ns32k/ns32k.c, config/rs6000/host-darwin.c, + config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, + config/sh/symbian.c, config/stormy16/stormy16.c, + config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< + and %> as appropriate. Use %' as apostrophe in diagnostics where + applicable. Use %< and %> in place of '' quotes where applicable. + Use %qs in place of %<%s%>. Consistently quote __builtin function + names. + 2004-11-09 Hans-Peter Nilsson * gdbinit.in (pbb, pbm): New macros. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2612f478718..a4f166de22b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2004-11-09 Joseph S. Myers + + * misc.c (gnat_handle_option): Use %< and %> for quoting in + warning message. + 2004-11-08 Rainer Orth * a-numaux-x86.adb (Tan): Fix fdivp syntax. diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index f74626ad4ed..7f77df3e3a8 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -296,7 +296,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) break; case OPT_gant: - warning ("`-gnat' misspelled as `-gant'"); + warning ("%<-gnat%> misspelled as %<-gant%>"); /* ... fall through ... */ diff --git a/gcc/builtins.c b/gcc/builtins.c index 3749e0ef011..0d60c4dfa1b 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -929,7 +929,7 @@ expand_builtin_prefetch (tree arglist) /* Argument 1 must be either zero or one. */ if (INTVAL (op1) != 0 && INTVAL (op1) != 1) { - warning ("invalid second arg to __builtin_prefetch; using zero"); + warning ("invalid second arg to %<__builtin_prefetch%>; using zero"); op1 = const0_rtx; } @@ -943,7 +943,7 @@ expand_builtin_prefetch (tree arglist) /* Argument 2 must be 0, 1, 2, or 3. */ if (INTVAL (op2) < 0 || INTVAL (op2) > 3) { - warning ("invalid third arg to __builtin_prefetch; using zero"); + warning ("invalid third arg to %<__builtin_prefetch%>; using zero"); op2 = const0_rtx; } @@ -5486,7 +5486,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, if (value != const1_rtx) { - error ("__builtin_longjmp second argument must be 1"); + error ("%<__builtin_longjmp%> second argument must be 1"); return const0_rtx; } diff --git a/gcc/c-common.c b/gcc/c-common.c index 08d895e36bb..4a3944c0712 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4311,7 +4311,7 @@ handle_mode_attribute (tree *node, tree name, tree args, if (mode == VOIDmode) { - error ("unknown machine mode %<%s%>", p); + error ("unknown machine mode %qs", p); return NULL_TREE; } @@ -4342,7 +4342,7 @@ handle_mode_attribute (tree *node, tree name, tree args, } if (!valid_mode) { - error ("unable to emulate %<%s%>", p); + error ("unable to emulate %qs", p); return NULL_TREE; } @@ -4352,7 +4352,7 @@ handle_mode_attribute (tree *node, tree name, tree args, if (!targetm.valid_pointer_mode (mode)) { - error ("invalid pointer mode %<%s%>", p); + error ("invalid pointer mode %qs", p); return NULL_TREE; } diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 12f89aaacc1..d30b24a06bd 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1005,14 +1005,14 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl, if (TREE_CHAIN (t) == 0 && TYPE_MAIN_VARIANT (type) != void_type_node) { - inform ("a parameter list with an ellipsis can't match " + inform ("a parameter list with an ellipsis can%'t match " "an empty parameter name list declaration"); break; } if (c_type_promotes_to (type) != type) { - inform ("an argument type that has a default promotion can't match " + inform ("an argument type that has a default promotion can%'t match " "an empty parameter name list declaration"); break; } @@ -5063,7 +5063,7 @@ grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs, return NULL_TREE; } if (pedantic) - pedwarn ("ISO C doesn't support unnamed structs/unions"); + pedwarn ("ISO C doesn%'t support unnamed structs/unions"); } value = grokdeclarator (declarator, declspecs, FIELD, false, diff --git a/gcc/c-format.c b/gcc/c-format.c index e5009a32fea..8faeb173c2a 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -212,7 +212,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) if (!get_constant (first_arg_num_expr, &info->first_arg_num, validated_p)) { - error ("'...' has invalid operand number"); + error ("%<...%> has invalid operand number"); return false; } @@ -2496,7 +2496,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args, if (arg_num != info.first_arg_num) { if (!(flags & (int) ATTR_FLAG_BUILT_IN)) - error ("args to be formatted is not '...'"); + error ("args to be formatted is not %<...%>"); *no_add_attrs = true; return NULL_TREE; } diff --git a/gcc/c-format.h b/gcc/c-format.h index a1861b54477..9ce610391fe 100644 --- a/gcc/c-format.h +++ b/gcc/c-format.h @@ -161,7 +161,7 @@ typedef struct nonzero character that may be found in flags2 if it describes the flag when used with certain formats only. If the latter, only the first such entry found that applies to the current conversion - specifier is used; the values of `name' and `long_name' it supplies + specifier is used; the values of 'name' and 'long_name' it supplies will be used, if non-NULL and the standard version is higher than the unpredicated one, for any pedantic warning. For example, 'o' for strftime formats (meaning 'O' is an extension over C99). */ @@ -170,10 +170,10 @@ typedef struct be skipped ('=' in strfmon), zero otherwise. */ int skip_next_char; /* The name to use for this flag in diagnostic messages. For example, - N_("`0' flag"), N_("field width"). */ + N_("'0' flag"), N_("field width"). */ const char *name; /* Long name for this flag in diagnostic messages; currently only used for - "ISO C does not support ...". For example, N_("the `I' printf flag"). */ + "ISO C does not support ...". For example, N_("the 'I' printf flag"). */ const char *long_name; /* The standard version in which it appeared. */ enum format_std_version std; diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 1affab4e7b8..86880ac6153 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -733,7 +733,7 @@ primary: c = fold ($3.value); STRIP_NOPS (c); if (TREE_CODE (c) != INTEGER_CST) - error ("first argument to __builtin_choose_expr not" + error ("first argument to %<__builtin_choose_expr%> not" " a constant"); $$ = integer_zerop (c) ? $7 : $5; } diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 8b212358087..5c71ad107b3 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -127,7 +127,7 @@ pch_init (void) f = fopen (pch_file, "w+b"); if (f == NULL) - fatal_error ("can't create precompiled header %s: %m", pch_file); + fatal_error ("can%'t create precompiled header %s: %m", pch_file); pch_outfile = f; gcc_assert (strlen (host_machine) < 256 @@ -155,7 +155,7 @@ pch_init (void) || fwrite (target_machine, v.target_machine_length, 1, f) != 1 || fwrite (version_string, v.version_length, 1, f) != 1 || fwrite (target_validity, v.target_data_length, 1, f) != 1) - fatal_error ("can't write to %s: %m", pch_file); + fatal_error ("can%'t write to %s: %m", pch_file); /* We need to be able to re-read the output. */ /* The driver always provides a valid -o option. */ @@ -190,12 +190,12 @@ c_common_write_pch (void) h.asm_size = asm_file_end - asm_file_startpos; if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); + fatal_error ("can%'t write %s: %m", pch_file); buf = xmalloc (16384); if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0) - fatal_error ("can't seek in %s: %m", asm_file_name); + fatal_error ("can%'t seek in %s: %m", asm_file_name); for (written = asm_file_startpos; written < asm_file_end; ) { @@ -203,23 +203,23 @@ c_common_write_pch (void) if (size > 16384) size = 16384; if (fread (buf, size, 1, asm_out_file) != 1) - fatal_error ("can't read %s: %m", asm_file_name); + fatal_error ("can%'t read %s: %m", asm_file_name); if (fwrite (buf, size, 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); + fatal_error ("can%'t write %s: %m", pch_file); written += size; } free (buf); /* asm_out_file can be written afterwards, so fseek to clear _IOREAD flag. */ if (fseek (asm_out_file, 0, SEEK_END) != 0) - fatal_error ("can't seek in %s: %m", asm_file_name); + fatal_error ("can%'t seek in %s: %m", asm_file_name); gt_pch_save (pch_outfile); cpp_write_pch_state (parse_in, pch_outfile); if (fseek (pch_outfile, 0, SEEK_SET) != 0 || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); + fatal_error ("can%'t write %s: %m", pch_file); fclose (pch_outfile); } @@ -245,7 +245,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) sizeread = read (fd, ident, IDENT_LENGTH); if (sizeread == -1) - fatal_error ("can't read %s: %m", name); + fatal_error ("can%'t read %s: %m", name); else if (sizeread != IDENT_LENGTH) return 2; @@ -273,12 +273,12 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) /* At this point, we know it's a PCH file, so it ought to be long enough that we can read a c_pch_validity structure. */ if (read (fd, &v, sizeof (v)) != sizeof (v)) - fatal_error ("can't read %s: %m", name); + fatal_error ("can%'t read %s: %m", name); strings_length = (v.host_machine_length + v.target_machine_length + v.version_length); if (read (fd, short_strings, strings_length) != strings_length) - fatal_error ("can't read %s: %m", name); + fatal_error ("can%'t read %s: %m", name); if (v.host_machine_length != strlen (host_machine) || memcmp (host_machine, short_strings, strlen (host_machine)) != 0) { @@ -362,7 +362,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if ((size_t) read (fd, this_file_data, v.target_data_length) != v.target_data_length) - fatal_error ("can't read %s: %m", name); + fatal_error ("can%'t read %s: %m", name); msg = targetm.pch_valid_p (this_file_data, v.target_data_length); free (this_file_data); if (msg != NULL) @@ -495,7 +495,7 @@ c_common_pch_pragma (cpp_reader *pfile) fd = open (name, O_RDONLY | O_BINARY, 0666); if (fd == -1) - fatal_error ("%s: couldn't open PCH file: %m\n", name); + fatal_error ("%s: couldn%'t open PCH file: %m\n", name); if (c_common_valid_pch (pfile, name, fd) != 1) { diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index f59bfc07023..24c166658b4 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -618,7 +618,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) visibility_options.inpragma = 1; } if (c_lex (&x) != CPP_CLOSE_PAREN) - GCC_BAD ("missing '(' after %<#pragma GCC visibility push%> - ignored"); + GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored"); } } if (c_lex (&x) != CPP_EOF) diff --git a/gcc/collect2.c b/gcc/collect2.c index a8eaf111309..cc55cf4de00 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1562,7 +1562,7 @@ collect_execute (const char *prog, char **argv, const char *redir) since we might not end up needing something that we could not find. */ if (argv[0] == 0) - fatal ("cannot find `%s'", prog); + fatal ("cannot find '%s'", prog); if (redir) { @@ -2039,7 +2039,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) /* If we do not have an `nm', complain. */ if (nm_file_name == 0) - fatal ("cannot find `nm'"); + fatal ("cannot find 'nm'"); nm_argv[argc++] = nm_file_name; if (NM_FLAGS[0] != '\0') @@ -2206,7 +2206,7 @@ scan_libraries (const char *prog_name) /* If we do not have an `ldd', complain. */ if (ldd_file_name == 0) { - error ("cannot find `ldd'"); + error ("cannot find 'ldd'"); return; } diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 5151571116e..125f01a6e41 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -303,7 +303,7 @@ override_options (void) else if (! strcmp (alpha_tp_string, "i")) alpha_tp = ALPHA_TP_INSN; else - error ("bad value `%s' for -mtrap-precision switch", alpha_tp_string); + error ("bad value %qs for -mtrap-precision switch", alpha_tp_string); } if (alpha_fprm_string) @@ -317,7 +317,7 @@ override_options (void) else if (! strcmp (alpha_fprm_string,"d")) alpha_fprm = ALPHA_FPRM_DYN; else - error ("bad value `%s' for -mfp-rounding-mode switch", + error ("bad value %qs for -mfp-rounding-mode switch", alpha_fprm_string); } @@ -332,7 +332,7 @@ override_options (void) else if (strcmp (alpha_fptm_string, "sui") == 0) alpha_fptm = ALPHA_FPTM_SUI; else - error ("bad value `%s' for -mfp-trap-mode switch", alpha_fptm_string); + error ("bad value %qs for -mfp-trap-mode switch", alpha_fptm_string); } if (alpha_tls_size_string) @@ -344,7 +344,7 @@ override_options (void) else if (strcmp (alpha_tls_size_string, "64") == 0) alpha_tls_size = 64; else - error ("bad value `%s' for -mtls-size switch", alpha_tls_size_string); + error ("bad value %qs for -mtls-size switch", alpha_tls_size_string); } alpha_cpu @@ -363,7 +363,7 @@ override_options (void) break; } if (! cpu_table [i].name) - error ("bad value `%s' for -mcpu switch", alpha_cpu_string); + error ("bad value %qs for -mcpu switch", alpha_cpu_string); } if (alpha_tune_string) @@ -375,7 +375,7 @@ override_options (void) break; } if (! cpu_table [i].name) - error ("bad value `%s' for -mcpu switch", alpha_tune_string); + error ("bad value %qs for -mcpu switch", alpha_tune_string); } /* Do some sanity checks on the above options. */ @@ -457,7 +457,7 @@ override_options (void) } else { - warning ("bad value `%s' for -mmemory-latency", alpha_mlat_string); + warning ("bad value %qs for -mmemory-latency", alpha_mlat_string); lat = 3; } diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 9773d697f33..6a334c012da 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -391,14 +391,14 @@ arc_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED, if (TREE_CODE (value) != STRING_CST) { - warning ("argument of `%s' attribute is not a string constant", + warning ("argument of %qs attribute is not a string constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (strcmp (TREE_STRING_POINTER (value), "ilink1") && strcmp (TREE_STRING_POINTER (value), "ilink2")) { - warning ("argument of `%s' attribute is not \"ilink1\" or \"ilink2\"", + warning ("argument of %qs attribute is not \"ilink1\" or \"ilink2\"", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index dab5de5020a..914babe02e0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2605,7 +2605,7 @@ arm_handle_fndecl_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2623,7 +2623,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2637,7 +2637,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (arm_isr_value (args) == ARM_FT_UNKNOWN) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -2664,7 +2664,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); } } } diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index d080b8d1840..573194dbce5 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -4511,7 +4511,7 @@ avr_handle_progmem_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -4530,7 +4530,7 @@ avr_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -4612,7 +4612,7 @@ static void avr_file_start (void) { if (avr_asm_only_p) - error ("MCU `%s' supported for assembler only", avr_mcu_name); + error ("MCU %qs supported for assembler only", avr_mcu_name); default_file_start (); diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index aeacecb5057..22465fc1873 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -4496,7 +4496,7 @@ c4x_handle_fntype_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_TYPE) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index e01b383a4f2..c84a9be190e 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1214,7 +1214,7 @@ darwin_handle_weak_import_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 0347c16f1e8..19faaa67592 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -9613,7 +9613,7 @@ frv_int_to_acc (enum insn_code icode, int opnum, rtx opval) if (! (*insn_data[icode].operand[opnum].predicate) (reg, VOIDmode)) { - error ("inappropriate accumulator for `%s'", insn_data[icode].name); + error ("inappropriate accumulator for %qs", insn_data[icode].name); return NULL_RTX; } return reg; @@ -9702,12 +9702,12 @@ frv_check_constant_argument (enum insn_code icode, int opnum, rtx opval) { if (GET_CODE (opval) != CONST_INT) { - error ("`%s' expects a constant argument", insn_data[icode].name); + error ("%qs expects a constant argument", insn_data[icode].name); return FALSE; } if (! (*insn_data[icode].operand[opnum].predicate) (opval, VOIDmode)) { - error ("constant argument out of range for `%s'", insn_data[icode].name); + error ("constant argument out of range for %qs", insn_data[icode].name); return FALSE; } return TRUE; diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 564eecdfca2..b7810358456 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -5752,7 +5752,7 @@ h8300_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -5776,7 +5776,7 @@ h8300_handle_eightbit_data_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -5799,7 +5799,7 @@ h8300_handle_tiny_data_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ba515867ed7..5f45e4295e8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1271,10 +1271,10 @@ override_options (void) error ("bad value (%s) for -masm= switch", ix86_asm_string); } if ((TARGET_64BIT == 0) != (ix86_cmodel == CM_32)) - error ("code model `%s' not supported in the %s bit mode", + error ("code model %qs not supported in the %s bit mode", ix86_cmodel_string, TARGET_64BIT ? "64" : "32"); if (ix86_cmodel == CM_LARGE) - sorry ("code model `large' not supported yet"); + sorry ("code model % not supported yet"); if ((TARGET_64BIT != 0) != ((target_flags & MASK_64BIT) != 0)) sorry ("%i-bit mode not compiled in", (target_flags & MASK_64BIT) ? 64 : 32); @@ -1682,7 +1682,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1710,7 +1710,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name, if (TARGET_64BIT) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1728,7 +1728,7 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1739,13 +1739,13 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args, cst = TREE_VALUE (args); if (TREE_CODE (cst) != INTEGER_CST) { - warning ("`%s' attribute requires an integer constant argument", + warning ("%qs attribute requires an integer constant argument", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (compare_tree_int (cst, REGPARM_MAX) > 0) { - warning ("argument to `%s' attribute larger than %d", + warning ("argument to %qs attribute larger than %d", IDENTIFIER_POINTER (name), REGPARM_MAX); *no_add_attrs = true; } @@ -6538,7 +6538,7 @@ print_operand (FILE *file, rtx x, int code) return; } default: - output_operand_lossage ("invalid operand code `%c'", code); + output_operand_lossage ("invalid operand code '%c'", code); } } @@ -14507,7 +14507,7 @@ ix86_handle_struct_attribute (tree *node, tree name, if (!(type && (TREE_CODE (*type) == RECORD_TYPE || TREE_CODE (*type) == UNION_TYPE))) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -14516,7 +14516,7 @@ ix86_handle_struct_attribute (tree *node, tree name, || ((is_attribute_p ("gcc_struct", name) && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))))) { - warning ("`%s' incompatible attribute ignored", + warning ("%qs incompatible attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 845960eb3e9..c8a75440f89 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -71,7 +71,7 @@ ix86_handle_shared_attribute (tree *node, tree name, { if (TREE_CODE (*node) != VAR_DECL) { - warning ("`%s' attribute only applies to variables", + warning ("%qs attribute only applies to variables", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -296,7 +296,7 @@ i386_pe_mark_dllimport (tree decl) abort (); if (i386_pe_dllexport_name_p (oldname)) { - error ("`%s' declared as both exported to and imported from a DLL", + error ("%qs declared as both exported to and imported from a DLL", IDENTIFIER_POINTER (DECL_NAME (decl))); return; } diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 0b65686512c..a8fdec4385f 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -477,7 +477,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBU } else { - warning ("invalid argument of `%s' attribute", + warning ("invalid argument of %qs attribute", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -509,7 +509,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBU break; default: - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; break; } diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c index 4b58fe07e30..a1eddebdc4d 100644 --- a/gcc/config/ip2k/ip2k.c +++ b/gcc/config/ip2k/ip2k.c @@ -3160,7 +3160,7 @@ ip2k_handle_progmem_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -3178,7 +3178,7 @@ ip2k_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 6871d0aa956..4788f9b24f4 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -2842,7 +2842,7 @@ expand_one_builtin (enum insn_code icode, rtx target, tree arglist, op[i] = expand_expr (arg[i], NULL_RTX, VOIDmode, 0); mode[i] = insn_data[icode].operand[i].mode; if (code[i] == CONST_INT && GET_CODE (op[i]) != CONST_INT) - error ("argument `%d' is not a constant", i + 1); + error ("argument %qd is not a constant", i + 1); if (code[i] == REG && ! (*insn_data[icode].operand[i].predicate) (op[i], mode[i])) op[i] = copy_to_mode_reg (mode[i], op[i]); diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index b5621568997..384b5ae09fd 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -353,7 +353,7 @@ m32r_handle_model_attribute (tree *node ATTRIBUTE_UNUSED, tree name, && arg != large_ident1 && arg != large_ident2) { - warning ("invalid argument of `%s' attribute", + warning ("invalid argument of %qs attribute", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 651c642d953..e134f576f62 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -1311,7 +1311,7 @@ m68hc11_handle_page0_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1347,7 +1347,7 @@ m68hc11_handle_fntype_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1432,13 +1432,13 @@ m68hc11_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) trap_handler = lookup_attribute ("trap", func_attr) != NULL_TREE; if (trap_handler && is_far) { - warning ("`trap' and `far' attributes are not compatible, ignoring `far'"); + warning ("% and % attributes are not compatible, ignoring %"); trap_handler = 0; } if (trap_handler) { if (trap_handler_symbol != 0) - warning ("`trap' attribute is already used"); + warning ("% attribute is already used"); else trap_handler_symbol = XEXP (rtl, 0); } diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 18b8fb41501..1db78d93d21 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -285,7 +285,7 @@ m68k_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index a7a36f90d9d..b3ededee8f8 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -253,9 +253,9 @@ extern int target_flags; { "nobitfield", - MASK_BITFIELD, \ N_("Do not use the bit-field instructions") }, \ { "short", MASK_SHORT, \ - N_("Consider type `int' to be 16 bits wide") }, \ + N_("Consider type 'int' to be 16 bits wide") }, \ { "noshort", - MASK_SHORT, \ - N_("Consider type `int' to be 32 bits wide") }, \ + N_("Consider type 'int' to be 32 bits wide") }, \ { "68881", MASK_68881, "" }, \ { "soft-float", - MASK_68881, \ N_("Generate code with library calls for floating point") }, \ diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index dbd3599d60f..57e5174dbc7 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -2984,7 +2984,7 @@ mcore_override_options (void) || (mcore_stack_increment == 0 && (mcore_stack_increment_string[0] != '0' || mcore_stack_increment_string[1] != 0))) - error ("invalid option `-mstack-increment=%s'", + error ("invalid option %<-mstack-increment=%s%>", mcore_stack_increment_string); } @@ -3372,7 +3372,7 @@ mcore_handle_naked_attribute (tree * node, tree name, tree args ATTRIBUTE_UNUSED } else { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 4aa3b082a16..665e3841dc3 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -7541,7 +7541,7 @@ build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code) Fortunately, this case is illegal, since it means that a function was declared in two different ways in a single compilation. */ if (fpret && ! l->fpret) - error ("cannot handle inconsistent calls to `%s'", fnname); + error ("cannot handle inconsistent calls to %qs", fnname); /* If we are calling a stub which handles a floating point return value, we need to arrange to save $18 in the prologue. We do diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 98d8d60fd38..4f79df2814b 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -1585,7 +1585,7 @@ mmix_print_operand (FILE *stream, rtx x, int code) default: /* Presumably there's a missing case above if we get here. */ - internal_error ("MMIX Internal: Missing `%c' case in mmix_print_operand", code); + internal_error ("MMIX Internal: Missing %qc case in mmix_print_operand", code); } switch (GET_CODE (modified_x)) diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c index 696e86b8188..d70f3089806 100644 --- a/gcc/config/ns32k/ns32k.c +++ b/gcc/config/ns32k/ns32k.c @@ -1065,7 +1065,7 @@ ns32k_handle_fntype_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c index d04270c3675..599e30603d6 100644 --- a/gcc/config/rs6000/host-darwin.c +++ b/gcc/config/rs6000/host-darwin.c @@ -101,7 +101,7 @@ segv_handler (int sig ATTRIBUTE_UNUSED, if (strcmp (shell_commands[i][0], shell_name + 1) == 0) { fnotice (stderr, - "Try running `%s' in the shell to raise its limit.\n", + "Try running '%s' in the shell to raise its limit.\n", shell_commands[i][1]); } } diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index abd3473e830..54c76dba304 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1268,7 +1268,7 @@ rs6000_override_options (const char *default_cpu) else if (! strncmp (rs6000_traceback_name, "no", 2)) rs6000_traceback = traceback_none; else - error ("unknown -mtraceback arg `%s'; expecting `full', `partial' or `none'", + error ("unknown -mtraceback arg %qs; expecting %, % or %", rs6000_traceback_name); } @@ -1369,7 +1369,7 @@ rs6000_override_options (const char *default_cpu) while (base[-1] != 'm') base--; if (*rs6000_longcall_switch != '\0') - error ("invalid option `%s'", base); + error ("invalid option %qs", base); rs6000_default_long_calls = (base[0] != 'n'); } @@ -1380,7 +1380,7 @@ rs6000_override_options (const char *default_cpu) while (base[-1] != 'm') base--; if (*rs6000_warn_altivec_long_switch != '\0') - error ("invalid option `%s'", base); + error ("invalid option %qs", base); rs6000_warn_altivec_long = (base[0] != 'n'); } @@ -1677,7 +1677,7 @@ rs6000_parse_tls_size_option (void) else if (strcmp (rs6000_tls_size_string, "64") == 0) rs6000_tls_size = 64; else - error ("bad value `%s' for -mtls-size switch", rs6000_tls_size_string); + error ("bad value %qs for -mtls-size switch", rs6000_tls_size_string); } void @@ -6798,7 +6798,7 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, if (TREE_CODE (arg2) != INTEGER_CST || TREE_INT_CST_LOW (arg2) & ~0x3) { - error ("argument to `%s' must be a 2-bit unsigned literal", d->name); + error ("argument to %qs must be a 2-bit unsigned literal", d->name); return const0_rtx; } @@ -6926,7 +6926,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) while (TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == ADDR_EXPR || TREE_CODE (arg0) == ARRAY_REF) arg0 = TREE_OPERAND (arg0, 0); - error ("invalid parameter combination for `%s' AltiVec intrinsic", + error ("invalid parameter combination for %qs AltiVec intrinsic", TREE_STRING_POINTER (arg0)); return const0_rtx; @@ -16746,7 +16746,7 @@ rs6000_handle_altivec_attribute (tree *node, tree name, tree args, *no_add_attrs = true; /* No need to hang on to the attribute. */ if (!result) - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); else *node = reconstruct_complex_type (*node, result); @@ -16781,7 +16781,7 @@ rs6000_handle_longcall_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 8189de09d41..b4b4c452092 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6827,11 +6827,11 @@ s390_emit_prologue (void) if (s390_warn_framesize > 0 && cfun_frame_layout.frame_size >= s390_warn_framesize) - warning ("frame size of `%s' is " HOST_WIDE_INT_PRINT_DEC " bytes", + warning ("frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes", current_function_name (), cfun_frame_layout.frame_size); if (s390_warn_dynamicstack_p && cfun->calls_alloca) - warning ("`%s' uses dynamic stack allocation", current_function_name ()); + warning ("%qs uses dynamic stack allocation", current_function_name ()); /* Save incoming stack pointer into temp reg. */ if (cfun_frame_layout.save_backchain_p || next_fpr) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index cf8bb41fafc..699f316064e 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -7150,7 +7150,7 @@ sh_handle_interrupt_handler_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7171,21 +7171,21 @@ sh_handle_sp_switch_attribute (tree *node, tree name, tree args, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (!pragma_interrupt) { /* The sp_switch attribute only has meaning for interrupt functions. */ - warning ("`%s' attribute only applies to interrupt functions", + warning ("%qs attribute only applies to interrupt functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST) { /* The argument must be a constant string. */ - warning ("`%s' attribute argument not a string constant", + warning ("%qs attribute argument not a string constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7206,21 +7206,21 @@ sh_handle_trap_exit_attribute (tree *node, tree name, tree args, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (!pragma_interrupt) { /* The trap_exit attribute only has meaning for interrupt functions. */ - warning ("`%s' attribute only applies to interrupt functions", + warning ("%qs attribute only applies to interrupt functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST) { /* The argument must be a constant integer. */ - warning ("`%s' attribute argument not an integer constant", + warning ("%qs attribute argument not an integer constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7348,7 +7348,7 @@ sh_pch_valid_p (const void *data_p, size_t len) make_message: { char *r; - asprintf (&r, _("created and used with differing settings of `-m%s'"), + asprintf (&r, _("created and used with differing settings of '-m%s'"), flag_that_differs); if (r == NULL) return _("out of memory"); diff --git a/gcc/config/sh/symbian.c b/gcc/config/sh/symbian.c index 02b95f5970d..cb04c8c8d76 100644 --- a/gcc/config/sh/symbian.c +++ b/gcc/config/sh/symbian.c @@ -276,7 +276,7 @@ sh_symbian_mark_dllimport (tree decl) if (sh_symbian_dllexport_name_p (oldname)) { - error ("`%s' declared as both exported to and imported from a DLL", + error ("%qs declared as both exported to and imported from a DLL", IDENTIFIER_POINTER (DECL_NAME (decl))); } else if (sh_symbian_dllimport_name_p (oldname)) @@ -411,14 +411,14 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args, | (int) ATTR_FLAG_FUNCTION_NEXT | (int) ATTR_FLAG_ARRAY_NEXT)) { - warning ("`%s' attribute ignored", attr); + warning ("%qs attribute ignored", attr); *no_add_attrs = true; return tree_cons (name, args, NULL_TREE); } if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE) { - warning ("`%s' attribute ignored", attr); + warning ("%qs attribute ignored", attr); *no_add_attrs = true; } @@ -433,7 +433,7 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args, { if (DECL_INITIAL (node)) { - error ("%Hvariable `%D' definition is marked dllimport.", + error ("%Hvariable %qD definition is marked dllimport.", & DECL_SOURCE_LOCATION (node), node); *no_add_attrs = true; } diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 76195cad37e..06a2f0d3fb6 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1918,7 +1918,7 @@ xstormy16_print_operand (FILE *file, rtx x, int code) if (GET_CODE (x) == CONST_INT) xx = INTVAL (x); else - output_operand_lossage ("`B' operand is not constant"); + output_operand_lossage ("'B' operand is not constant"); /* GCC sign-extends masks with the MSB set, so we have to detect all the cases that differ only in sign extension @@ -1945,7 +1945,7 @@ xstormy16_print_operand (FILE *file, rtx x, int code) } if (l == -1) - output_operand_lossage ("`B' operand has multiple bits set"); + output_operand_lossage ("'B' operand has multiple bits set"); fprintf (file, IMMEDIATE_PREFIX HOST_WIDE_INT_PRINT_DEC, l); return; @@ -1971,7 +1971,7 @@ xstormy16_print_operand (FILE *file, rtx x, int code) if (GET_CODE (x) == CONST_INT) xx = INTVAL (x); else - output_operand_lossage ("`o' operand is not constant"); + output_operand_lossage ("'o' operand is not constant"); if (code == 'O') xx = -xx; @@ -1989,7 +1989,7 @@ xstormy16_print_operand (FILE *file, rtx x, int code) if (GET_CODE (x) == CONST_INT) xx = INTVAL (x); else - output_operand_lossage ("`B' operand is not constant"); + output_operand_lossage ("'B' operand is not constant"); l = 7 - xx; @@ -2410,7 +2410,7 @@ xstormy16_handle_interrupt_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_TYPE) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2431,7 +2431,7 @@ xstormy16_handle_below100_attribute (tree *node, && TREE_CODE (*node) != POINTER_TYPE && TREE_CODE (*node) != TYPE_DECL) { - warning ("`__BELOW100__' attribute only applies to variables"); + warning ("%<__BELOW100__%> attribute only applies to variables"); *no_add_attrs = true; } else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL) diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 98c24c94ffe..8154b6616f1 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -2204,7 +2204,7 @@ v850_handle_interrupt_attribute (tree * node, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning ("%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f94382ed0aa..8ac1df2fd12 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2004-11-09 Joseph S. Myers + + * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, + pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for + quoting in diagnostics. + * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for + quoting in printf format. + * decl.c (duplicate_decls, start_decl): Use %qD instead of + unquoted %D. + 2004-11-08 Kazu Hirata * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c, diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 3c726432f8e..613d0d4493e 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3400,7 +3400,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) - warning ("enumeral mismatch in conditional expression: `%T' vs `%T'", + warning ("enumeral mismatch in conditional expression: %qT vs %qT", arg2_type, arg3_type); else if (extra_warnings && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 63e2cf74666..e146abc0223 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5529,7 +5529,7 @@ push_lang_context (tree name) current_lang_name = name; } else - error ("language string `\"%E\"' not recognized", name); + error ("language string %<\"%E\"%> not recognized", name); } /* Get out of the current language scope. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b429a783e7f..a6961215396 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1848,7 +1848,7 @@ duplicate_decls (tree newdecl, tree olddecl) that specialization that would cause an implicit instantiation to take place, in every translation unit in which such a use occurs. */ - error ("explicit specialization of %D after first use", + error ("explicit specialization of %qD after first use", olddecl); SET_DECL_TEMPLATE_SPECIALIZATION (olddecl); @@ -3781,7 +3781,7 @@ start_decl (const cp_declarator *declarator, initialization. Thus, duplicate_decls won't warn about this situation, and so we check here. */ if (DECL_INITIAL (decl) && DECL_INITIAL (field)) - error ("duplicate initialization of %D", decl); + error ("duplicate initialization of %qD", decl); if (duplicate_decls (decl, field)) decl = field; } @@ -7052,7 +7052,7 @@ grokdeclarator (const cp_declarator *declarator, /* Warn about storage classes that are invalid for certain kinds of declarations (parameters, typenames, etc.). */ if (declspecs->multiple_storage_classes_p) - error ("multiple storage classes in declaration of `%s'", name); + error ("multiple storage classes in declaration of %qs", name); else if (thread_p && ((storage_class && storage_class != sc_extern diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 310f386d48f..03c51e77907 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -961,7 +961,7 @@ grokfield (const cp_declarator *declarator, case FIELD_DECL: if (asmspec) - error ("`asm' specifiers are not permitted on non-static data members"); + error ("% specifiers are not permitted on non-static data members"); if (DECL_INITIAL (value) == error_mark_node) init = error_mark_node; cp_finish_decl (value, init, NULL_TREE, flags); @@ -3030,7 +3030,7 @@ cp_finish_file (void) already verified there was a definition. */ && !DECL_EXPLICIT_INSTANTIATION (decl)) { - cp_warning_at ("inline function `%D' used but never defined", decl); + cp_warning_at ("inline function %qD used but never defined", decl); /* This symbol is effectively an "extern" declaration now. This is not strictly necessary, but removes a duplicate warning. */ diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 9c7642a533f..07fa6d9ddf1 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2230,7 +2230,7 @@ print_instantiation_partial_context (diagnostic_context *context, xloc = expand_location (loc); if (t == NULL_TREE) break; - pp_verbatim (context->printer, "%s:%d: instantiated from `%s'\n", + pp_verbatim (context->printer, "%s:%d: instantiated from %qs\n", xloc.file, xloc.line, decl_as_string (TINST_DECL (t), TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); @@ -2370,7 +2370,7 @@ locate_error (const char *msgid, va_list ap) default: errorcount = 0; /* damn ICE suppression */ - internal_error ("unexpected letter `%c' in locate_error\n", *f); + internal_error ("unexpected letter %qc in locate_error\n", *f); } } } diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 1aeb3beb401..eb9f8f075a2 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2169,7 +2169,7 @@ write_expression (tree expr) expression without extending the C++ ABI. */ if (code == COND_EXPR && i == 1 && !operand) { - error ("omitted middle operand to `?:' operand " + error ("omitted middle operand to % operand " "cannot be mangled"); continue; } @@ -2479,7 +2479,7 @@ static inline const char * finish_mangling (const bool warn) { if (warn_abi && warn && G.need_abi_warning) - warning ("the mangled name of `%D' will change in a future " + warning ("the mangled name of %qD will change in a future " "version of GCC", G.entity); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 646013ad35a..ef02ba9f514 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1821,7 +1821,7 @@ cp_parser_name_lookup_error (cp_parser* parser, error ("%<%T::%D%> has not been declared", parser->object_scope, name); else - error ("`%D' has not been declared", name); + error ("%qD has not been declared", name); } else if (parser->scope && parser->scope != global_namespace) error ("%<%D::%D%> %s", parser->scope, name, desired); @@ -15228,7 +15228,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) /* Initialize FORMAT the first time we get here. */ if (!format) - format = "types may not be defined in `%s' expressions"; + format = "types may not be defined in '%s' expressions"; /* Types cannot be defined in a `sizeof' expression. Save away the old message. */ @@ -15266,7 +15266,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) type = cp_parser_type_id (parser); parser->in_type_id_in_expr_p = saved_in_type_id_in_expr_p; /* Now, look for the trailing `)'. */ - cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); + cp_parser_require (parser, CPP_CLOSE_PAREN, "%<)%>"); /* If all went well, then we're done. */ if (cp_parser_parse_definitely (parser)) { diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c35fd11fd3f..28ae8f375b3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1795,7 +1795,7 @@ check_explicit_specialization (tree declarator, error("too few template parameter lists in declaration of %qD", decl); else error("explicit specialization of %qD must be introduced by " - "`template <>'", decl); + "%