bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnulib] obstack.c fix to work around HP-UX cc bug


From: Paul Eggert
Subject: [bug-gnulib] obstack.c fix to work around HP-UX cc bug
Date: Tue, 18 Jan 2005 13:10:10 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed this into gnulib:

2005-01-18  Bob Proulx  <address@hidden>

        Merge changes from coreutils.
        * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
        offsetof() macro construct to avoid compile failure with native HP-UX
        11.0 ANSI C compiler.

Index: lib/obstack.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/obstack.c,v
retrieving revision 1.29
diff -p -u -r1.29 obstack.c
--- lib/obstack.c       11 Aug 2004 22:39:58 -0000      1.29
+++ lib/obstack.c       18 Jan 2005 21:06:56 -0000
@@ -1,7 +1,7 @@
 /* obstack.c - subroutines used implicitly by object stack macros
 
    Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -74,12 +74,17 @@ union fooround
   long double d;
   void *p;
 };
+struct fooalign
+{
+  char c;
+  union fooround u;
+};
 /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
    But in fact it might be less smart and round addresses to as much as
    DEFAULT_ROUNDING.  So we prepare for it to do that.  */
 enum
   {
-    DEFAULT_ALIGNMENT = offsetof (struct { char c; union fooround u; }, u),
+    DEFAULT_ALIGNMENT = offsetof (struct fooalign, u),
     DEFAULT_ROUNDING = sizeof (union fooround)
   };
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]