On Thursday 19 June 2008 13:33:13 Andrew Johnson wrote: > These warnings occur when compiling on Solaris, both x86 and sparc: > > "src/packfile.c", line 351: warning: argument #1 is incompatible with > prototype: > prototype: pointer to char : "/usr/include/sys/mman.h", line 161 > argument : pointer to long > "src/packfile.c", line 878: warning: argument #1 is incompatible with > prototype: > prototype: pointer to char : "/usr/include/sys/mman.h", line 161 > argument : pointer to long > > The sys/mman.h header file line 161 defines: > > extern int munmap(caddr_t, size_t); > > Note that from the above warning messages, we know that caddr_t is char*. > > However the sys/mman.h file has two other definitions of munmap, depending > on some configuration macros. These are the relevent lines: > > #ifdef __STDC__ > #if (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) > > extern int munmap(void *, size_t); > > #else /* (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) */ > > extern int munmap(caddr_t, size_t); > > #else /* __STDC__ */ > > extern int munmap(); > > #endif /* __STDC__ */ > > I don't know what the Parrot convention is for setting these macros or I'd > have included a patch.
We could move those file inclusions into include/parrot/packfile.h, and then wrap those defines in a Solaris-specific block. That seems reasonably clean to me. (#ifdef hell is more manageable in header files than source files.) If you worked up a patch that satisfied your sense of aesthetics, it'd probably pass muster. -- c