Date: Sun, 05 Jan 2003 14:25:02 +0000 From: "Richard Dawe" Sender: rich AT phekda DOT freeserve DOT co DOT uk To: djgpp-workers AT delorie DOT com X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 Subject: mkdoc: @port-note needs to be before @portability [PATCH] Message-Id: Reply-To: djgpp-workers AT delorie DOT com Hello. I've just discovered that mkdoc ignores @port-notes, if they come after @portability. Please find below a patch to make mkdoc warn, when this happens. Also in the patch is a fix for the page for _Exit, so that its @port-note is before @portability. OK to commit? Bye, Rich =] Index: src/mkdoc/mkdoc.cc =================================================================== RCS file: /cvs/djgpp/djgpp/src/mkdoc/mkdoc.cc,v retrieving revision 1.5 diff -p -c -3 -r1.5 mkdoc.cc *** src/mkdoc/mkdoc.cc 13 Feb 2002 21:03:10 -0000 1.5 --- src/mkdoc/mkdoc.cc 5 Jan 2003 14:21:57 -0000 *************** *** 1,3 **** --- 1,4 ---- + /* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ *************** struct Node { *** 127,136 **** --- 128,139 ---- PortInfo port_info[NUM_PORT_TARGETS]; PortNote *port_notes; PortNote *last_port_note; + int written_portability; Node(char *name, char *cat); void add(char *line); void process(char *line); void error(char *str, ...); + void warning(char *str, ...); void extend_portability_note(char *str); void read_portability_note(char *str); void read_portability(char *str); *************** Node::Node(char *Pname, char *Pcat) *** 162,167 **** --- 165,171 ---- bzero(&port_info[i], sizeof(port_info[i])); port_notes = NULL; last_port_note = NULL; + written_portability = 0; } void *************** Node::error (char *str, ...) *** 191,196 **** --- 195,213 ---- } void + Node::warning (char *str, ...) + { + va_list arg; + char s[1024]; + + va_start (arg, str); + vsprintf (s, str, arg); + va_end (arg); + + fprintf (stderr, "Warning (file %s, node %s): %s\n", filename, name, s); + } + + void Node::extend_portability_note(char *str) { int newsize = strlen (last_port_note->note) + strlen (str) + 1; *************** Node::read_portability_note(char *str) *** 207,212 **** --- 224,234 ---- char *target; int i, j; + if (written_portability) { + warning("%s", "@port-note must come before @portability."); + warning("%s", "Ignoring all @port-note for this node."); + } + while (isspace(*s)) s++; target = s; while (*s && !isspace(*s)) s++; *************** Node::write_portability() *** 551,556 **** --- 573,580 ---- delete p; } last_port_note = NULL; + + written_portability++; } void Index: src/libc/c99/stdlib/_exit.txh =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/c99/stdlib/_exit.txh,v retrieving revision 1.1 diff -p -c -3 -r1.1 _exit.txh *** src/libc/c99/stdlib/_exit.txh 30 Nov 2002 09:27:03 -0000 1.1 --- src/libc/c99/stdlib/_exit.txh 5 Jan 2003 14:21:57 -0000 *************** This function does not return. *** 21,29 **** @subheading Portability - @portability !ansi-c89, ansi-c99, !posix-1003.2-1992, posix-1003.1-2001 - @port-note ansi-c99 Depending on the implementation, @code{_Exit} may do the additional processing described above. @subheading Example --- 21,29 ---- @subheading Portability @port-note ansi-c99 Depending on the implementation, @code{_Exit} may do the additional processing described above. + + @portability !ansi-c89, ansi-c99, !posix-1003.2-1992, posix-1003.1-2001 @subheading Example