This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Update^5: Fix PR other/44034
- From: Joern Rennecke <amylaar at spamcop dot net>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Gerald Pfeifer <gerald at pfeifer dot com>, Richard Guenther <richard dot guenther at gmail dot com>, bonzini at gnu dot org, dj at redhat dot com, neroden at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Fri, 18 Jun 2010 05:27:48 -0400
- Subject: Re: Update^5: Fix PR other/44034
- References: <20100526035246.h4v4fkajq8kcs0wk-nzlynne@webmail.spamcop.net> <Pine.LNX.4.64.1005261121220.6834@digraph.polyomino.org.uk> <20100526074705.ybxjn3la80cwkgg4-nzlynne@webmail.spamcop.net> <20100526114501.naowcook48wo0kwg-nzlynne@webmail.spamcop.net> <20100528121743.sj8wuutpdwo8ggkc-nzlynne@webmail.spamcop.net> <20100607181903.vsr8r9994w8sk4o0-nzlynne@webmail.spamcop.net> <20100608230324.rh3qk1dp9usgswsg-nzlynne@webmail.spamcop.net> <Pine.LNX.4.64.1006172005130.22472@digraph.polyomino.org.uk>
Quoting "Joseph S. Myers" <joseph@codesourcery.com>:
The comments at the start of target.def should explain the macro
DEFHOOK_UNDOC. They should also make clear which cases are obsolescent
and should not be used for new hooks but are used for existing hooks
pending appropriate license approvals from the FSF and the writing of
documentation for hooks currently lacking it (as I understand it, all
cases involving _UNDOC, "*" or "" for documentation or the presence of a
comment above a DEFHOOK* macro call).
Like this?
/* A hook should generally be documented by a string in the DOC parameter,
which should contain texinfo markup. If the documentation is only
available
under the GPL, but not under the GFDL, put it in a comment above the hook
definition. If the function declaration is available both under GPL and
GFDL, but the documentation is only available under the GFDL, put the
documentaton in tm.texi.in, heading with @hookdoc <hookname> and closing
the paragraph with @end deftypefn / deftypevr as appropriate, and marking
the next autogenerated hook with @hookdoc <hookname>.
In both these cases, leave the DOC string empty, i.e. "".
Sometimes, the function declaration itself is only available under the
GPL, and/or for some historic reason it has to be documented differently
than what it is. In that case, use DEFHOOK_UNDOC to supress
auto-generation
of documentation. DEFHOOK_UNDOC takes a DOC string which it ignores, so
you can put GPLed documentation string there if you have hopes that you
can clear the declaration & documentation for GFDL distribution later,
in which case you can then simply change the DEFHOOK_UNDOC to DEFHOOK
to turn on the autogeneration of the documentation.
A documentation string of "*" means not to emit any documentation at all,
and is mainly used internally for DEFHOOK_UNDOC. It should generally not
be used otherwise, but it has its use for exceptional cases where automatic
documentation is not wanted, and the real documentation is elsewere, like
for TARGET_ASM_{,UN}ALIGNED_INT_OP, which are hooks only for implementation
purposes; they refer to structs, the components of which are documented as
separate hooks TARGET_ASM_{,UN}ALIGNED_[HSDT]I_OP.
A DOC string of 0 is for internal use of DEFHOOKPODX and special table
entries only. */
New generator files such as genhooks.c should be listed in po/EXCLUDES so
they don't get messages extracted from them for translation.
genhooks.c has an unchecked fopen call; just because a previous call to
fopen for the same file succeeded doesn't mean a new one will.
Is am currently putting a patch to r160960 with fixes to the issues you
raised through a regression test; it also has a DEFHOOK_UNDOC for the new
declare_constant_name, which unfortunately differs in argument naming in
varasm.c / config/darwin.c from tm.texi. (exp is GPLed vs. expr is GFDLed)