bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PASS] grep-2.15 on HP-UX 11.31 with HP C-ANSI-C


From: Paul Eggert
Subject: Re: [PASS] grep-2.15 on HP-UX 11.31 with HP C-ANSI-C
Date: Thu, 31 Oct 2013 09:49:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

Thanks for the heads-up.  All but one of those warnings
are false alarms.  There is one that in theory could lead
to undefined behavior on some platforms (though not yours)
and I hope I have fixed it by installing the following gnulib
patch, which grep should pick up in due course.

>From e240f3332e018f40b52caf4810ad4d7fbfb219c5 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Thu, 31 Oct 2013 09:44:44 -0700
Subject: [PATCH] obstack: pacify HP C

* lib/obstack.h (obstack_free) [!__GNUC__]: Rewrite to avoid
warning "conversion from pointer to smaller integer" from HP
C-ANSI-C - cc version B9007AA/B3910B A.06.26.  It's safe to assume
C89 or later nowadays, so cast to void instead of int.  Privately
reported by H.Merijn Brand.  Also, change header to match glibc's,
to make checking against glibc easier.
---
 ChangeLog     | 10 ++++++++++
 lib/obstack.h | 26 +++++++++++++-------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e2fb971..009382c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-10-31  Paul Eggert  <address@hidden>
+
+    obstack: pacify HP C
+    * lib/obstack.h (obstack_free) [!__GNUC__]: Rewrite to avoid
+    warning "conversion from pointer to smaller integer" from HP
+    C-ANSI-C - cc version B9007AA/B3910B A.06.26.  It's safe to assume
+    C89 or later nowadays, so cast to void instead of int.  Privately
+    reported by H.Merijn Brand.  Also, change header to match glibc's,
+    to make checking against glibc easier.
+
 2013-10-29  Jim Meyering  <address@hidden>
 
     maint.mk: prefer gpgv2 over gpgv
diff --git a/lib/obstack.h b/lib/obstack.h
index da45427..67c0b55 100644
--- a/lib/obstack.h
+++ b/lib/obstack.h
@@ -1,20 +1,20 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988-1994, 1996-1999, 2003-2006, 2009-2013 Free Software
-   Foundation, Inc.
+   Copyright (C) 1988-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with this program; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /* Summary:
 
@@ -501,9 +501,9 @@ __extension__                                               
            \
 ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk,             \
   ((((h)->temp.tempint > 0                                              \
     && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk))     \
-   ? (int) ((h)->next_free = (h)->object_base                           \
-            = (h)->temp.tempint + (char *) (h)->chunk)                  \
-   : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 
0)))
+   ? (void) ((h)->next_free = (h)->object_base                          \
+             = (h)->temp.tempint + (char *) (h)->chunk)                 \
+   : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk)))
 
 #endif /* not __GNUC__ */
 
-- 
1.8.3.1





reply via email to

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