comparison lib/obstack.h @ 37224:5cde1ab8e8aa

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 31 Oct 2013 09:44:44 -0700
parents f23811891fc5
children 344018b6e5d7
comparison
equal deleted inserted replaced
37223:b821a5c78c89 37224:5cde1ab8e8aa
1 /* obstack.h - object stack macros 1 /* obstack.h - object stack macros
2 Copyright (C) 1988-1994, 1996-1999, 2003-2006, 2009-2013 Free Software 2 Copyright (C) 1988-2013 Free Software Foundation, Inc.
3 Foundation, Inc.
4 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
5 4
6 This program is free software: you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or
7 it under the terms of the GNU General Public License as published by 6 modify it under the terms of the GNU Lesser General Public
8 the Free Software Foundation; either version 3 of the License, or 7 License as published by the Free Software Foundation; either
9 (at your option) any later version. 8 version 2.1 of the License, or (at your option) any later version.
10 9
11 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 GNU General Public License for more details. 13 Lesser General Public License for more details.
15 14
16 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Lesser General Public
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 16 License along with this program; if not, see
17 <http://www.gnu.org/licenses/>. */
18 18
19 /* Summary: 19 /* Summary:
20 20
21 All the apparent functions defined here are macros. The idea 21 All the apparent functions defined here are macros. The idea
22 is that you would use these pre-tested macros to solve a 22 is that you would use these pre-tested macros to solve a
499 499
500 # define obstack_free(h,obj) \ 500 # define obstack_free(h,obj) \
501 ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ 501 ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \
502 ((((h)->temp.tempint > 0 \ 502 ((((h)->temp.tempint > 0 \
503 && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ 503 && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \
504 ? (int) ((h)->next_free = (h)->object_base \ 504 ? (void) ((h)->next_free = (h)->object_base \
505 = (h)->temp.tempint + (char *) (h)->chunk) \ 505 = (h)->temp.tempint + (char *) (h)->chunk) \
506 : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) 506 : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk)))
507 507
508 #endif /* not __GNUC__ */ 508 #endif /* not __GNUC__ */
509 509
510 #ifdef __cplusplus 510 #ifdef __cplusplus
511 } /* C++ */ 511 } /* C++ */