From: Pierre Muller <muller@ics.u-strasbg.fr>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] remove calls to fprintf in language parsers
Date: Fri, 21 Jun 2002 07:40:00 -0000 [thread overview]
Message-ID: <4.2.0.58.20020621162359.020aaba8@ics.u-strasbg.fr> (raw)
In-Reply-To: <3D133498.1020708@cygnus.com>
At 16:13 21/06/2002 , Andrew Cagney a écrit:
>>At 02:49 21/06/2002 , Andrew Cagney a écrit:
>>
>>>>+/* Function used to avoid direct calls to fprintf
>>>>+ in the code generated by the bison parser. */
>>>>+
>>>>+extern void parser_fprintf (FILE *, const char *, ...);
>>
>>>
>>>Hmm, wonder if there is any benefit in adding ATTR_FORMAT(printf, 2, 3) to the declaration?
>>
>>I didn't even know this modifier :(
>
>BTW, attr_format was only added to error() (one of GDBs most important functions) a month or so ago. While the attribute has been around for a while, it is relativly new for GDB.
>
>>But it does look appropriate indeed.
>
>My only reservation was that bison/yacc could turn out to generate badly formatted printf statements. However, if that is happening then we need to know anyway.
Isn't it the purpose of this modifer to check if the format and the parameter list match?
>As for indentation. GNU indent doesn't handle ATTR_FORMAT() very well so any location is likely ok.
>
>>>Anyway, yes,
>>
>>Does this mean I can apply the patch?
>
>Yes, either way.
Committed.
>Andrew
>(I'm just happy to see these fprintf() slowly disappearing :-)
The only fprintf call remaining
(at least for cygwin native GDB) is in tracepoint.c
function tracepoint_save_command
but this is directly to a disk file, so it shouldn't harm any program using GDB lib
like Insight.
Nevertheless for consistency,
this FILE *fp local var should probably also be converted into a
ui_file by using gdb_fopen instead of fopen, no?
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
prev parent reply other threads:[~2002-06-21 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-20 2:44 Pierre Muller
2002-06-20 17:49 ` Andrew Cagney
2002-06-21 0:52 ` Pierre Muller
2002-06-21 7:13 ` Andrew Cagney
2002-06-21 7:40 ` Pierre Muller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4.2.0.58.20020621162359.020aaba8@ics.u-strasbg.fr \
--to=muller@ics.u-strasbg.fr \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox