From patchwork Sat Sep 24 19:58:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: non-GNU C++ compilers X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 116259 Message-Id: To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org Date: Sat, 24 Sep 2011 21:58:14 +0200 (CEST) From: Marc Glisse List-Id: On Sat, 17 Sep 2011, Joseph S. Myers wrote: > These are OK (with ChangeLog entries properly omitting the "include/", > since they go in include/ChangeLog) in the absence of libiberty maintainer > objections within 72 hours. Thanks. Is someone willing to commit them now they have been accepted? I am attaching them as a single patch and copying the changelog entries here for convenience (I wrote the date of Monday because it looks like a day where someone might have time to commit...). include/ChangeLog: 2011-09-26 Ulrich Drepper * obstack.h [!GNUC] (obstack_free): Avoid cast to int. 2011-09-26 Marc Glisse * ansidecl.h (ENUM_BITFIELD): Always use enum in C++ Index: include/ansidecl.h =================================================================== --- include/ansidecl.h (revision 179146) +++ include/ansidecl.h (working copy) @@ -416,10 +416,12 @@ #define EXPORTED_CONST const #endif -/* Be conservative and only use enum bitfields with GCC. +/* Be conservative and only use enum bitfields with C++ or GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ -#if (GCC_VERSION > 2000) +#ifdef __cplusplus +#define ENUM_BITFIELD(TYPE) enum TYPE +#elif (GCC_VERSION > 2000) #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE #else #define ENUM_BITFIELD(TYPE) unsigned int Index: include/obstack.h =================================================================== --- include/obstack.h (revision 179146) +++ include/obstack.h (working copy) @@ -532,9 +532,9 @@ # define obstack_free(h,obj) \ ( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) + ? (((h)->next_free = (h)->object_base \ + = (h)->temp + (char *) (h)->chunk), 0) \ + : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0))) #endif /* not __GNUC__ or not __STDC__ */