任务单 #39856

sys/stat.h defines S_IXUSR but not S_IXGRP or S_IXOTH

开放日期: 2019-12-19 05:16 最后更新: 2020-01-17 09:15

报告人:
属主:
(无)
类型:
状态:
关闭
组件:
里程碑:
(无)
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Rejected
文件:
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

sys/stat.h in MinGW only defines S_IXUSR but not S_IXOTH or S_IXGRP. Why not? A number of program use those bits and thus can't be compiled with mingw.

任务单历史 (2/2 Histories)

2019-12-19 05:16 Updated by: cbiesinger_g
  • New Ticket "sys/stat.h defines S_IXUSR but not S_IXGRP or S_IXOTH" created
2020-01-17 09:15 Updated by: keith
  • 处理结果 Update from to Rejected
  • 状态 Update from 开启 to 关闭
评论

First, let me make it clear that it was not my choice to define S_IXUSR, (or the closely related S_IRUSR, S_IWUSR, and S_IRWXU flags), in MinGW's <sys/stat.h>; the appropriate Microsoft compatible flags are _S_IEXEC, _S_IREAD, _S_WRITE, and the boolean sum thereof, (or their old, legacy names, without the leading underscore). That said, the POSIX flags names which are defined do map, quite well, to the corresponding Microsoft names, which may offer some justification for having defined them. OTOH, the S_IXGRP, S_IXOTH, S_IRGRP, S_IROTH, S_IWGRP, S_IWOTH, S_IRWXG, and S_IRWXO flags simply have no viable corresponding equivalents in the Microsoft Windows world, so there can be no plausible justification for defining them.

This seems to be closely related to the discussion I had with Steve Kargl, on GCC Bugzilla. That was, ultimately, resolved in favour of not defining these flags, in MinGW headers, but rather adapting libgfortran to recognize that they have no place on this platform; I see no reason to reverse this decision now. In fact, from my viewpoint, the compiler errors when you try to compile code which gratuitously uses them, provide a valuable clue that you need to modify the application code, to make it portable.

(Edited, 2020-01-17 09:16 Updated by: keith)

Attachment File List

No attachments

编辑

Please login to add comment to this ticket » 登录名