This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fixincludes bug fix for egcs-1.1.2 dec-alpha-osf3.2


The fixincludes process for egcs-1.1.2 on dec-alpha-osf3.2 creates
a file include/kern/queue.h which contains a syntax error.
Fortunately the syntax error occurs in a region which is inside
`#ifdef __KERNEL__', so normally it is not a major problem,
but unfortunately even when it is ifdef'd out, it still triggers
warnings of the form "warning: `/*' within comment" when compiling
with `-Wall'.

The problem is that fixincludes translates "//..." into "/*...*/"
even when the "//" occurs inside a multi-line "/*...*/" style comment.

Here's the original header file:

	=== /usr/include/kern/queue.h ===
	...
	/*
	 *	Macro:		queue_init
	 *	Function:
	 *		Initialize the given queue.
	 *	Header:
	 *		void queue_init(q)
	 *			queue_t		q;	// MODIFIED
	 */
	#define queue_init(q)	((q)->next = (q)->prev = q)

Here's the broken header file produced by fixincludes:

	=== gcc/include/kern/queue.h ===
	...
	/*
	 *      Macro:          queue_init
	 *      Function:
	 *              Initialize the given queue.
	 *      Header:
	 *              void queue_init(q)
	 *                      queue_t         q;      /* MODIFIED*/
	 */
	#define queue_init(q)   ((q)->next = (q)->prev = q)

Here's a patch to fix the problem.

--- fixincludes.old	Fri Mar  5 11:24:01 1999
+++ fixincludes	Wed Apr 21 05:38:13 1999
@@ -1166,6 +1166,18 @@
   fi
 fi
 
+# And also with the Alpha/OSF 3.2 kern/queue.h file
+file=kern/queue.h
+if [ -r ${LIB}/$file ]; then
+  if egrep 'Type definitions for generic queues' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+    sed -e 's|//.*$||g' $file > ${LIB}/$file
+    chmod +w ${LIB}/$file 2>/dev/null
+    chmod a+r ${LIB}/$file 2>/dev/null
+  fi
+fi
+
 # And also with the HP-UX 10 and HP-UX 11 sys/pci.h file
 file=sys/pci.h
 if [ -r ${LIB}/$file ]; then
-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3        |     -- the last words of T. S. Garp.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]