From: Johannes Sixt Date: Tue, 08 Dec 2009 20:31:43 GMT Subject: Re: [RFC PATCH v2 2/2] MSVC: Fix an "incompatible pointer types" compiler warning Message-ID: <200912082131.44498.j6t@kdbg.org> In-Reply-To: <4B1EAD9A.3090205@ramsay1.demon.co.uk> On Dienstag, 8. Dezember 2009, Ramsay Jones wrote: > 30 #define stat _stat64 > 31 int mingw_lstat(const char *file_name, struct stat *buf); > 32 int mingw_fstat(int fd, struct stat *buf); > 33 #define fstat mingw_fstat > 34 #define lstat mingw_lstat > 35 #define _stat64(x,y) mingw_lstat(x,y) > 36 #define ALREADY_DECLARED_STAT_FUNCS > 37 > 38 #include "compat/mingw.h" > 39 > 40 #undef ALREADY_DECLARED_STAT_FUNCS > > This works fine, *provided* you do not need to compile with > -D_USE_32BIT_TIME_T, which would produce this warning: > > ...mingw.c(223) : warning C4133: 'function' : incompatible types - \ > from '_stat64 *' to '_stat32i64 *' > > This would actually be *worse* than the original code, since the struct > _stat64 would not have the same "shape" as the struct _stat32i64; ... To cut this short: According to your explanations, using -D_USE_32BIT_TIME_T with MSVC is bad. Please reroll without references to _USE_32BIT_TIME_T. -- Hannes