This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Use LDPL_FATAL instead of assert
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>, Cary Coutant <ccoutant at google dot com>
- Date: Thu, 15 Oct 2009 21:00:50 +0000 (UTC)
- Subject: Re: [patch] Use LDPL_FATAL instead of assert
- References: <38a0d8450910151133o563baec6qcd685a9ba1eceb70@mail.gmail.com>
On Thu, 15 Oct 2009, Rafael Espindola wrote:
> +static void
> +check (bool gate, enum ld_plugin_level level, const char *text)
> +{
> + if (gate)
> + return;
> +
> + if (message)
> + message (level, text);
The following may not need fixing for the initial commit, but it would
still be a good idea to fix them:
Is this callback interface defined to take translated or untranslated
text? If untranslated, there would be a problem with the callback knowing
which textual domain to use for translation, so I'd guess it should be
defined to take translated messages. This means you should be translating
the messages first, using dgettext to use the right domain (which I think
should be "gcc" rather than inventing yet another domain for a few
messages). You also need to call bindtextdomain - see how cpplib does
things for an example of one domain being used in a library in a program
that mainly uses another domain (cpplib and gcc there, gcc and whatever
domain the linker uses - it appears to be "gold" - here). Then
gcc/po/exgettext needs to get the messages extracted for translation into
gcc/po/gcc.pot.
> + check (t <= 4, LDPL_FATAL, "Invalid symbol kind found.");
See the GNU Coding Standards for diagnostics, which do not start with a
capital letter or end with ".". Likewise for many other diagnostics.
--
Joseph S. Myers
joseph@codesourcery.com