Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Wu Zhou <woodzltc@cn.ibm.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: two questions about GDB coding standards
Date: Wed, 18 May 2005 15:43:00 -0000	[thread overview]
Message-ID: <1116411881.428b17e9beb01@imap.linux.ibm.com> (raw)

Quoting Mark Kettenis <mark.kettenis@xs4all.nl>:

> The usage of sprintf is mainly historic, and a bad example that
> shouldn't be followed.  Patches to get rid of it are welcome, and
> mostly obvious ;-).  Whether xasprintf is the right replacement,
> depends on the context.  In some cases the usage of xsnprintf might be
> more appropriate.  The later is a version of snprintf that checks
> whether the generated string fits in the buffer.

Where can I find any document about xasprintf or xsnprintf?  I can find 
xasprintf's definition in the source tree of libiberty, but didn't find
any definition for xsnprintf.  Where is it defined then?   

> As configure.ac says, -Wunused-variable is up for debate. Looks like
> you just started that debate ;-).  But before we enable it someone
> will have to do the dirty work of finding most of the unused
> variables, such that compiling with -Werror keeps being possible.
> Elimination of unused variables is defenitely obvious, but watch out
> for tricky #ifdef's.
 
Sorry I didn't notice that this is mentioned in configure.ac.  And my 
intention was also not to start debate.  But I _do_ think that removing 
these unused variables might be achievable.  My initial idea is to use
static analysis tool to detect unused variables first.  Then double check 
to eliminate these false negatives. and then use a script to remove the 
definition automatically.  What is your thought on this?  Please review
and comment.  Thanks. 


Cheers
- Wu Zhou


             reply	other threads:[~2005-05-18 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-18 15:43 Wu Zhou [this message]
2005-05-18 19:53 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2005-05-19  8:47 Wu Zhou
2005-05-20  1:45 ` Eli Zaretskii
2005-05-19  8:08 Wu Zhou
2005-05-18 10:25 Wu Zhou
2005-05-18 13:02 ` Mark Kettenis
2005-05-17 20:19 Wu Zhou
2005-05-17 20:30 ` Eli Zaretskii
2005-05-17 20:33 ` Mark Kettenis

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=1116411881.428b17e9beb01@imap.linux.ibm.com \
    --to=woodzltc@cn.ibm.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    /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