Commit d71ef9d4 by Bruce Korb Committed by Bruce Korb

inclhack.def: Add fix development commentary

1999-06-23  Bruce Korb  <ddsinc09@ix.netcom.com>
	*fixinc/inclhack.def:  Add fix development commentary
	(read_ret_type): reactivate and add selection clause
	(zzz_*): tweak output file name to match what is used in hackshell.tpl
	*fixinc/{fixincl.x|inclhack.sh}: regen

From-SVN: r27718
parent 05dfd09c
1999-06-23 Bruce Korb <ddsinc09@ix.netcom.com>
*fixinc/inclhack.def: Add fix development commentary
(read_ret_type): reactivate and add selection clause
(zzz_*): tweak output file name to match what is used in hackshell.tpl
*fixinc/{fixincl.x|inclhack.sh}: regen
Wed Jun 23 00:48:21 1999 Jason Merrill <jason@yorick.cygnus.com>
* expr.c (expand_expr): STRIP_NOPS before checking against
......
......@@ -3,8 +3,67 @@
autogen definitions inclhack;
/*
* Define all the fixes we know about for repairing damaged headers
*/
Define all the fixes we know about for repairing damaged headers
The rules for making fixes:
1. Every fix must have a "hackname" that is compatible with C syntax
for variable names and is unique without regard to alphabetic case.
2. If the problem is known to exist only in certain files,
then name each such file with a "files = " entry.
3. It is relatively expensive to fire off a process to fix a source
file, therefore write apply tests to avoid unnecessary fix
processes. The preferred apply tests are "select" and "bypass"
because they are performed internally. "test" sends a command
to a server shell that actually fires off one or more processes
to do the testing. Avoid it, if you can, but it is still more
efficient than a fix process.
These tests are required to:
1. Be positive for all header files that require the fix.
It is desireable to:
2. Be negative as often as possible whenever the fix is not
required, avoiding the process overhead.
It is nice if:
3. The expression is as simple as possible to both
process and uderstand by people. :-)
Please take advantage of the fact AutoGen will glue
together string fragments. It helps. Also take note
that double quote strings and single quote strings have
different formation rules. Double quote strings are
a tiny superset of C string syntax. Single quote strings
follow shell single quote string formation rules, except
that the backslash is processed before '\\', '\'' and '#'
characters (using C character syntax).
4. There are currently two methods of fixing a file:
1. a series of sed expressions. Each will be an individual
"-e" argument to a single invocation of sed.
2. a shell script. These scripts are _required_ to read all
of stdin in order to avoid pipe stalls. They may choose to
discard the input.
A C language subroutine method is planned for both tests and fixes
in the near term. Awk ought to be possible too, but there may
be portability issues that I am not familiar with.
5. If the fix is to remove the file (i.e. the fixing process broke
the file), then you must use a shell script that deletes all
copies of the output file and does not write _anything_ to stdout.
See the "zzz_*" fixes at the end of this file.
Let the fixes begin: */
/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the definition
......@@ -402,15 +461,15 @@ fix = {
files = "sys/stat.h";
sed = "/^static int[ \t]*[a-z]*stat(/i\\\n"
"#ifdef __cplusplus\\\n"
"extern \"C\"\\\n"
"{\\\n"
"#endif\\\n";
"#ifdef __cplusplus\\\n"
"extern \"C\"\\\n"
"{\\\n"
"#endif\\\n";
sed = "/^}$/a\\\n"
"#ifdef __cplusplus\\\n"
"}\\\n"
"#endif \/* __cplusplus *\/\\\n";
"#ifdef __cplusplus\\\n"
"}\\\n"
"#endif \/* __cplusplus *\/\\\n";
};
......@@ -1235,15 +1294,14 @@ fix = {
/*
* Fix return type of fread and fwrite on sysV68
*/
#ifdef LATER
fix = {
hackname = read_ret_type;
files = stdio.h;
select = "extern int\t.*, fread\\(\\), fwrite\\(\\)";
sed = "s/^\\(extern int\tfclose(), fflush()\\), "
"\\(fread(), fwrite()\\)\\(.*\\)$"
"/extern unsigned int\t\\2;\\\n\\1\\3/";
};
#endif
/*
......@@ -2386,7 +2444,7 @@ fix = {
select = 'These definitions are for HP Internal developers';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......@@ -2400,7 +2458,7 @@ fix = {
select = '11.00 HP-UX LP64';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......@@ -2414,7 +2472,7 @@ fix = {
select = 'kthread_create_caller_t';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......@@ -2428,7 +2486,7 @@ fix = {
select = 'Kernel Instrumentation Definitions';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......@@ -2445,7 +2503,7 @@ fix = {
/* shouldn't there be a select expression here??? */
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......@@ -2459,7 +2517,7 @@ fix = {
select = '11.0 and later representation of ki time';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
"rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
"rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment