From: Andrew Cagney <cagney@gnu.org>
To: Daniel Jacobowitz <drow@mvista.com>, Jim Ingham <jingham@apple.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: report valid values for all errors for enum variables...
Date: Tue, 28 Oct 2003 16:08:00 -0000 [thread overview]
Message-ID: <3F9D4B94.7040502@gnu.org> (raw)
In-Reply-To: <20031028040347.GA26218@nevyn.them.org>
Jim,
Since you're looking a that code, can you please tweak it so that it
uses a mem_file instead of the 1024 byte stack buffer.
Is there a test case?
Andrew
+ /* If there was an error, print an informative
+ error message. */
char msg[1024];
! if (arg == NULL)
! strcpy (msg, "Requires an argument.");
! else if (nmatches <= 0)
! sprintf (msg, "Undefined item: \"%s\".", arg);
! else if (nmatches > 1)
! sprintf (msg, "Ambiguous item \"%s\".", arg);
! strcat (msg, " Valid values are ");
for (i = 0; c->enums[i]; i++)
{
next prev parent reply other threads:[~2003-10-28 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-28 2:02 Jim Ingham
2003-10-28 4:03 ` Daniel Jacobowitz
2003-10-28 16:08 ` Andrew Cagney [this message]
2003-10-28 19:35 ` Jim Ingham
2003-10-29 15:15 ` Andrew Cagney
2003-10-29 19:03 ` Jim Ingham
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=3F9D4B94.7040502@gnu.org \
--to=cagney@gnu.org \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jingham@apple.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