scary GCC bug (causes hpoj v0.91 crash)

From: David Mosberger <>
Date: 2004-11-12 16:42:43
There is a rather scary and longstanding GCC bug [1] which causes
instant crashes if a program defines a struct with function-pointers
and that structure happens to be "packed".  Why anybody would want to
do such a thing is beyond me, but suffice it to say that hpoj v0.91 is
doing precisely that.  The current Debian/sarge package for hpoj is
definitely affected (any attempt to scan an image results in an
instant crash).

A patch to work around the problem is attached.

Perhaps the hpoj developers can tell us whether it was really
intentional to have the #pragma pack(1) span all of <stdlib.h> and




--- hpoj-0.91/include/hpojip.h	2002-07-25 02:01:24.000000000 -0700
+++ hpoj-0.91-davidm/include/hpojip.h	2004-11-11 21:19:58.775236374 -0800
@@ -131,12 +132,15 @@
 	float fl;
+#pragma pack ()
 #include "../lib/hpojip/xform.h"   // this file uses the above definitions
 typedef struct IP_XFORM_TBL_s FAR *LPIP_XFORM_TBL;
+#pragma pack (1)
@@ -587,8 +591,6 @@
 EXPORT(WORD) ipGetFuncPtrs (LPIP_JUMP_TBL lpJumpTbl);
-#pragma pack ()
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Fri Nov 12 00:43:28 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:32 EST