From: Ben Pfaff Date: Thu, 1 Oct 2009 04:50:13 +0000 (-0700) Subject: Fix numerous warnings about an unknown attribute rpl_malloc on mingw32. X-Git-Tag: fbsd72-i386-build23^0 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a36028028904e2e180aad4c6cf51bb109d2ff16;p=pspp-builds.git Fix numerous warnings about an unknown attribute rpl_malloc on mingw32. On mingw32, Gnulib replaces malloc by defining it as a macro that expands to rpl_malloc. Since MALLOC_LIKE used malloc as an identifier, even though it didn't refer to the malloc function per se, this instance of malloc also expanded to rpl_malloc, confusing GCC. GCC also accepts __malloc__ here, so this commit uses that spelling instead, which avoids the warning. --- diff --git a/src/libpspp/compiler.h b/src/libpspp/compiler.h index 563cc59b..d2281944 100644 --- a/src/libpspp/compiler.h +++ b/src/libpspp/compiler.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2009 Free Software Foundation, Inc. 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 @@ -45,7 +45,7 @@ non-`NULL' pointer it returns cannot alias any other pointer valid when the function returns. */ #if __GNUC__ > 2 -#define MALLOC_LIKE ATTRIBUTE ((malloc)) +#define MALLOC_LIKE ATTRIBUTE ((__malloc__)) #else #define MALLOC_LIKE #endif