I filed this against Fedora, but was told to forward it to upstream. I don't normally subscribe to upstream mingw development and don't have a mingw bug account, and therefore was unable to create a ticket at https://sourceforge.net/p/mingw-w64/bugs/, so I'm hoping this email does the trick.
On 11/23/2016 05:08 AM, [email protected] wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1397787 > > Bug ID: 1397787 > Summary: 64-bit mingw pid_t should be 'int', not '__int64' > Product: Fedora > Version: 24 > Component: mingw-headers > Assignee: [email protected] > Reporter: [email protected] > QA Contact: [email protected] > CC: [email protected], [email protected], > [email protected], [email protected] > > > > Description of problem: > POSIX requires getpid() to return pid_t(). Since we have: > > /usr/x86_64-w64-mingw32/sys-root/mingw/include/unistd.h: > int __cdecl getpid(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005; > > then it follows that pid_t MUST be 'int' on both 32- and 64-bit windows. Yet > mingw stupidly defines pid_t as a 64-bit type: > > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/types.h: > #ifndef _PID_T_ > #define _PID_T_ > #ifndef _WIN64 > typedef int _pid_t; > #else > __MINGW_EXTENSION > typedef __int64 _pid_t; > #endif > > which causes no end to portability headaches when trying to compile code for > mingw. > > Version-Release number of selected component (if applicable): > mingw64-headers-5.0-0.2.rc2.v5.x.git65a0c3.20160723.fc24.noarch > > How reproducible: > 100% > > Steps to Reproduce: > 1. Noticeable when cross-compiling something that does: > > pid_t x = getpid(); > printf("%d", x); > > while compiling with -Werror=format > 2. > 3. > > Actual results: > gcc complains about type mismatch > > Expected results: > it looks like 64-bit windows still has just 32-bit process ids, so pid_t > should > be just 32 bits always. > > Additional info: > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
