(do_include): Warn if find unreadable header file.
authorJim Wilson <wilson@gcc.gnu.org>
Tue, 2 Mar 1993 21:17:19 +0000 (13:17 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 2 Mar 1993 21:17:19 +0000 (13:17 -0800)
(errno.h): Move outside VMS specific section.

From-SVN: r3611

gcc/cccp.c

index 9f75cc0e188ecaf7f8cff73ce3a282bc276d40bf..3dcbf2abb1fd0da679334cbf607b760015670a98 100644 (file)
@@ -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 <errno.h>
+
 /* VMS-specific definitions */
 #ifdef VMS
 #include <time.h>
-#include <errno.h>             /* This defines "errno" properly */
 #include <perror.h>            /* This defines sys_errlist/sys_nerr properly */
 #include <descrip.h>
 #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;