From 66be918f5f9f78d74c70aa332756286ff9d0ccf2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 17 Nov 2016 14:53:02 +0000 Subject: [PATCH] gdb/c-exp.y: fprintf -> parser_fprintf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Switching GDB to make use of gnulib's C++ namespace support mode revealed these direct uses of fprintf in the C parser, where parser_fprintf should be used to handle rewiring stderr to gdb_stderr: ..../src/gdb/c-exp.y: In function ‘void c_print_token(FILE*, int, YYSTYPE)’: ..../src/gdb/c-exp.y:3220:45: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] pulongest (value.typed_val_int.val)); ^ ..../src/gdb/c-exp.y:3231:62: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "tsval", value.tsval.type, copy); ^ ..../src/gdb/c-exp.y:3237:57: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "sval<%s>", copy_name (value.sval)); ^ ..../src/gdb/c-exp.y:3243:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] copy_name (value.tsym.stoken)); ^ ..../src/gdb/c-exp.y:3254:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] value.ssym.is_a_field_of_this); ^ ..../src/gdb/c-exp.y:3258:70: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "bval<%s>", host_address_to_string (value.bval)); ^ gdb/ChangeLog: 2016-11-17 Pedro Alves * c-exp.y (c_print_token): Use parser_fprintf instead of fprintf. --- gdb/ChangeLog | 4 ++++ gdb/c-exp.y | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa454b8225..a479c6c7c6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-11-17 Pedro Alves + + * c-exp.y (c_print_token): Use parser_fprintf instead of fprintf. + 2016-11-17 Pedro Alves * ctf.c [USE_WIN32API] (mkdir): Delete. diff --git a/gdb/c-exp.y b/gdb/c-exp.y index f65e3a19e7..f08bb69acd 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -3215,9 +3215,9 @@ c_print_token (FILE *file, int type, YYSTYPE value) switch (type) { case INT: - fprintf (file, "typed_val_int<%s, %s>", - TYPE_SAFE_NAME (value.typed_val_int.type), - pulongest (value.typed_val_int.val)); + parser_fprintf (file, "typed_val_int<%s, %s>", + TYPE_SAFE_NAME (value.typed_val_int.type), + pulongest (value.typed_val_int.val)); break; case CHAR: @@ -3228,34 +3228,34 @@ c_print_token (FILE *file, int type, YYSTYPE value) memcpy (copy, value.tsval.ptr, value.tsval.length); copy[value.tsval.length] = '\0'; - fprintf (file, "tsval", value.tsval.type, copy); + parser_fprintf (file, "tsval", value.tsval.type, copy); } break; case NSSTRING: case VARIABLE: - fprintf (file, "sval<%s>", copy_name (value.sval)); + parser_fprintf (file, "sval<%s>", copy_name (value.sval)); break; case TYPENAME: - fprintf (file, "tsym", - TYPE_SAFE_NAME (value.tsym.type), - copy_name (value.tsym.stoken)); + parser_fprintf (file, "tsym", + TYPE_SAFE_NAME (value.tsym.type), + copy_name (value.tsym.stoken)); break; case NAME: case UNKNOWN_CPP_NAME: case NAME_OR_INT: case BLOCKNAME: - fprintf (file, "ssym", - copy_name (value.ssym.stoken), - (value.ssym.sym.symbol == NULL - ? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)), - value.ssym.is_a_field_of_this); + parser_fprintf (file, "ssym", + copy_name (value.ssym.stoken), + (value.ssym.sym.symbol == NULL + ? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)), + value.ssym.is_a_field_of_this); break; case FILENAME: - fprintf (file, "bval<%s>", host_address_to_string (value.bval)); + parser_fprintf (file, "bval<%s>", host_address_to_string (value.bval)); break; } } -- 2.34.1