From: Wu Zhou <woodzltc@cn.ibm.com>
To: gdb-patches@sources.redhat.com
Subject: two questions about GDB coding standards
Date: Tue, 17 May 2005 20:19:00 -0000 [thread overview]
Message-ID: <1116342801.428a0a113167f@imap.linux.ibm.com> (raw)
Hello all,
I am now reading GDB coding standards(section 13.4 of GDB Internals)
and have two questions as follow. Maybe someone of you could clarify
for me. Thanks in advance.
1. In section 13.4.2(memory management), it is said that gdb uses the
string function xstrdup and the print function xasprintf. But I saw
in the source codes that most places use sprintf instead. Besides
this in-consistence, we also know that sprintf is very prone to buffer
overflow error. So my question here is whether sprintf should be
replaced by xasprintf here or is there any plan to achieve this?
2. In section 13.4.3(compiler warnings), it is said that: due to the
way that gdb is implemented most functions have unused parameters.
Consequently the warning "-Wunused-parameter" is precluded from the
list. What is the way it refered in this context? BTW, I also find
there are many unused variables in gdb source codes by using a static
analysis tool. But there is no "-Wunused-variable" in compiler option
to detect this. My question here is: should this kind of unused
variables be detected or furthermore be removed out of the source to
make it more readable? The coding standards doesn't say anything
about this.
Thanks for your attention.
Cheers
- Wu Zhou
next reply other threads:[~2005-05-17 15:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-17 20:19 Wu Zhou [this message]
2005-05-17 20:30 ` Eli Zaretskii
2005-05-17 20:33 ` Mark Kettenis
2005-05-18 10:25 Wu Zhou
2005-05-18 13:02 ` Mark Kettenis
2005-05-18 15:43 Wu Zhou
2005-05-18 19:53 ` Eli Zaretskii
2005-05-19 8:08 Wu Zhou
2005-05-19 8:47 Wu Zhou
2005-05-20 1:45 ` Eli Zaretskii
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=1116342801.428a0a113167f@imap.linux.ibm.com \
--to=woodzltc@cn.ibm.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