Ticket #39856

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

Open Date: 2019-12-19 05:16 Last Update: 2020-01-17 09:15

Reporter:
Owner:
(None)
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Rejected
File:
None
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.

Ticket History (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
  • Resolution Update from None to Rejected
  • Status Update from Open to Closed
Comment

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

Edit

Please login to add comment to this ticket » Login