[Pixman] declaration of fence_malloc in util.[ch]

Maarten Bosmans mkbosmans at gmail.com
Sun Jan 23 07:54:18 PST 2011


Hi,

When cross-compiling pixman (0.21.4) with mingw, I get the following error:
  CC     utils.o
In file included from utils.c:3:0:
utils.h:14:0: warning: ignoring #pragma omp threadprivate
utils.c:298:1: error: conflicting types for 'fence_malloc'
utils.h:69:1: note: previous declaration of 'fence_malloc' was here

Complete build log:
https://build.opensuse.org/package/live_build_log?arch=i586&package=mingw32-pixman-unstable&project=home%3Amkbosmans%3Amingw32&repository=openSUSE_11.3

In test/util.c fence_malloc is implemented roughly as:

#if defined(HAVE_MPROTECT) && defined(HAVE_GETPAGESIZE) &&
defined(HAVE_SYS_MMAN_H)
void * fence_malloc (int64_t len)
{
  /* implementation */
}
#else
void * fence_malloc (int32_t len)
{
  return malloc (len);
}
#endif

While in test/util.h it is declared with an int64_t argument unconditionally.

What is the right resolution here? Either in the header file the
definition of fence_malloc should also depend on the HAVE_ macros, or
fence_malloc should always have an int64_t argument.

Maarten


More information about the Pixman mailing list