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:
Any chance you could file this upstream at https://mingw-w64.org/ please? I think they are in a much better position to find a solution to this.
https://sourceforge.net/p/mingw-w64/mailman/message/35509069/ [Ugh - the sourceforge mail archives are a bear to use]
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
According to upstream __int64 is correct here: https://sourceforge.net/p/mingw-w64/mailman/message/35509069/
(In reply to Kalev Lember from comment #6) > According to upstream __int64 is correct here: > https://sourceforge.net/p/mingw-w64/mailman/message/35509069/ No, that link mentions: > Eric, is correct, see > https://msdn.microsoft.com/en-us/library/t2y34y40.aspx for reference. which in turn mentions: int _getpid( void ); __int64 is wrong, getpid always returns 32-bit int.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Still a problem in F28: mingw64-headers-5.0.2-2.fc27.noarch still has: $ grep -i -C2 pid_t /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/types.h #endif #ifndef _PID_T_ #define _PID_T_ #ifndef _WIN64 typedef int _pid_t; #else __MINGW_EXTENSION typedef __int64 _pid_t; #endif #ifndef NO_OLDNAMES #undef pid_t typedef _pid_t pid_t; #endif #endif /* Not _PID_T_ */ #ifndef _MODE_T_
This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '28'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 28 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Still a problem, reopening.
See also https://sourceforge.net/p/mingw-w64/mailman/message/34497805/
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle. Changing version to '31'.
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.