G_MININT32 triggers compiler warning C4146 with Visual C++
When I try to build Wireshark (which depends on GLib) on Windows using Visual C++, I get the following error (we have warnings-as-errors enabled):
C:\Development\wireshark\wsutil\strtoi.c(101): warning C4146: unary minus operator applied to unsigned type, result still unsigned [C:\Development\wireshark\cmbuild\wsutil\wsutil.vcxproj]
This is because gtypes.h defines G_MININT32 in a way that Visual C++ doesn't like:
#define G_MININT32 ((gint32) -0x80000000)
Changing the define to
#define G_MININT32 ((gint32) (-0x7fffffff - 1))
gets rid of the warning.