diff --git a/gcc/cccp.c b/gcc/cccp.c index 9f75cc0e188..3dcbf2abb1f 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -87,10 +87,12 @@ typedef unsigned char U_CHAR; #endif /* USG */ #endif /* not VMS */ +/* This defines "errno" properly for VMS, and gives us EACCES. */ +#include + /* VMS-specific definitions */ #ifdef VMS #include -#include /* This defines "errno" properly */ #include /* This defines sys_errlist/sys_nerr properly */ #include #define O_RDONLY 0 /* Open arg for Read/Only */ @@ -3957,6 +3959,10 @@ get_filename: f = open (fname, O_RDONLY, 0666); if (f == -2) return 0; /* Already included this file */ +#ifdef EACCES + else if (f == -1 && errno == EACCES) + warning ("Header file %s exists, but is not readable", fname); +#endif if (redundant_include_p (fname)) { close (f); return 0;