aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorPhilipp Thomas <pthomas@suse.de>2002-02-17 14:23:53 +0000
committerPhilipp Thomas <pthomas@gcc.gnu.org>2002-02-17 14:23:53 +0000
commita52453cc4295af6f62d1e59faac80056c426a400 (patch)
tree03fe05fc78e4acec8f41d3b93c5865ae3c456739 /gcc/final.c
parent1c11abc46fe2ef296d8726ee1e0c98359de6f961 (diff)
downloadgcc-a52453cc4295af6f62d1e59faac80056c426a400.zip
gcc-a52453cc4295af6f62d1e59faac80056c426a400.tar.gz
gcc-a52453cc4295af6f62d1e59faac80056c426a400.tar.bz2
final.c (output_operand_lossage): Changed to accept printf style arguments.
2002-02-17 Philipp Thomas <pthomas@suse.de> * final.c (output_operand_lossage): Changed to accept printf style arguments. Change calls where necessary. * output.h (output_operand_lossage): Change declaration accordingly. Update copyright. * config/arc/arc.c config/fr30/fr30.c config/m32r/m32r.c config/m88k/m88k.c : Adapt all calls to output_operand_lossage. Update copyright date where necessary. * config/i386/i386.c (print_operand): Likewise. Remove use of sprintf. * config/cris/cris.c (cris_operand_lossage): Likewise. Rename parameter so that exgettext recognizes it as translatable message. (LOSE_AND_RETURN): Rename parameter to msgid. * po/gcc.pot: Regenerate. From-SVN: r49820
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 5f8de30..e8edf19 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2965,13 +2965,26 @@ alter_cond (cond)
In an `asm', it's the user's fault; otherwise, the compiler's fault. */
void
-output_operand_lossage (msgid)
- const char *msgid;
+output_operand_lossage VPARAMS ((const char *msgid, ...))
{
+ char *fmt_string;
+ char *new_message;
+ char *pfx_str;
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
+
+ pfx_str = this_is_asm_operands ? _("invalid `asm': ") : "output_operand: ";
+ asprintf (&fmt_string, "%s%s", pfx_str, _(msgid));
+ vasprintf (&new_message, fmt_string, ap);
+
if (this_is_asm_operands)
- error_for_asm (this_is_asm_operands, "invalid `asm': %s", _(msgid));
+ error_for_asm (this_is_asm_operands, "%s", new_message);
else
- internal_error ("output_operand: %s", _(msgid));
+ internal_error ("%s", new_message);
+
+ free (fmt_string);
+ free (new_message);
+ VA_CLOSE (ap);
}
/* Output of assembler code from a template, and its subroutines. */
@@ -3217,7 +3230,7 @@ output_asm_insn (template, operands)
c = atoi (p);
if (! ISDIGIT (*p))
- output_operand_lossage ("operand number missing after %-letter");
+ output_operand_lossage ("operand number missing after %%-letter");
else if (this_is_asm_operands
&& (c < 0 || (unsigned int) c >= insn_noperands))
output_operand_lossage ("operand number out of range");
@@ -3309,7 +3322,7 @@ output_asm_label (x)
&& NOTE_LINE_NUMBER (x) == NOTE_INSN_DELETED_LABEL))
ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
else
- output_operand_lossage ("`%l' operand isn't a label");
+ output_operand_lossage ("`%%l' operand isn't a label");
assemble_name (asm_out_file, buf);
}