[gccsdk] GCC 4.7.4 Rel 1 Dev 2014-01-08: Text file execute permission bit

Duncan Moore duncan.moore at gmx.com
Sat Mar 8 05:28:09 PST 2014


GCCSDK GCC 4.7.4 Release 1 Development 4.7.4 2014-01-08
http://www.riscos.info/downloads/gccsdk/testing/4.7.4/gccsdk-gcc-bin-4.7.4-Rel1dev.zip
SharedUnixLibrary 1.12
VirtualRPC-Adjust RISCOS 4.39

The execute permission bit for Text files has changed to be the same as 
for other filetypes. So the program below under gcc 4.1.2 gives:

Obey xxx
Text ---

and under gcc 4.7.4 gives:

Obey xxx
Text xxx

Was this change intentional? And will it stay like this, or be reverted 
to the 4.1.2 behaviour? (It affects some of my regression tests).

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
static void prot(const char* filename,const char* cmd) {
   system(cmd);
   struct stat s;
   stat(filename,&s);
   printf("%s %c%c%c\n",&cmd[17],
                        (s.st_mode & S_IXUSR ? 'x' : '-'),
                        (s.st_mode & S_IXGRP ? 'x' : '-'),
                        (s.st_mode & S_IXOTH ? 'x' : '-'));
}
int main(void) {
   system("Echo abc { > testfile }");
   prot("testfile","SetType testfile Obey");
   prot("testfile","SetType testfile Text");
   system("Delete testfile");
   return 0;
}

Regards
Duncan





More information about the gcc mailing list