summaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-21 22:03:27 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-21 22:03:27 +0000
commit23f9d23fbda2702fca843ea244aaf4c3fc4f96b5 (patch)
treebd4d818110af28233fe510b5b206e04287bd8f13 /gcc/cppfiles.c
parent5ec90c2e3b0271d62c6a78c37e9495878ea79d4a (diff)
downloadgcc-23f9d23fbda2702fca843ea244aaf4c3fc4f96b5.tar.gz
* cppfiles.c (STAT_SIZE_TOO_BIG): Define.
(read_include_file): Use STAT_SIZE_TOO_BIG. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47245 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index bacb8e18ef9..32994f7256e 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -73,6 +73,15 @@ struct include_file
unsigned char mapped; /* file buffer is mmapped */
};
+/* Variable length record files on VMS will have a stat size that includes
+ record control characters that won't be included in the read size. */
+#ifdef VMS
+# define FAB_C_VAR 2 /* variable length records (see Starlet fabdef.h) */
+# define STAT_SIZE_TOO_BIG(ST) ((ST).st_fab_rfm == FAB_C_VAR)
+#else
+# define STAT_SIZE_TOO_BIG(ST) 0
+#endif
+
/* The cmacro works like this: If it's NULL, the file is to be
included again. If it's NEVER_REREAD, the file is never to be
included again. Otherwise it is a macro hashnode, and the file is
@@ -392,7 +401,11 @@ read_include_file (pfile, inc)
goto perror_fail;
if (count == 0)
{
- cpp_warning (pfile, "%s is shorter than expected", inc->name);
+ if (!STAT_SIZE_TOO_BIG (inc->st))
+ cpp_warning
+ (pfile, "%s is shorter than expected", inc->name);
+ buf = xrealloc (buf, offset);
+ inc->st.st_size = offset;
break;
}
offset += count;