aboutsummaryrefslogtreecommitdiffstats
path: root/apps/apps.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-30 08:32:19 +0200
committerRichard Levitte <levitte@openssl.org>2016-03-30 20:25:08 +0200
commit90dbd25097d7d4af0bea0cd9cab60d749ed0a6a2 (patch)
tree1f1df714ee01a974d78f3b89f22c13953d63a364 /apps/apps.c
parentfcd9c8c0149d989bf0ab28e14bbaa49e5060db9b (diff)
downloadopenssl-90dbd25097d7d4af0bea0cd9cab60d749ed0a6a2.tar.gz
Fix pointer size issue with setbuf() on VMS
setbuf() is only for 32-bit pointers. If compiled with /POINTER_SIZE=64, we get a nasty warning about possible loss of data. However, since the only pointer used in the call is a FILE *, and the C RTL shouldn't give us a pointer above the first 4GB, it's safe to turn off the warning for this call. Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c
index 128f387593..e1241495ea 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -2499,7 +2499,21 @@ BIO *dup_bio_err(int format)
void unbuffer(FILE *fp)
{
+/*
+ * On VMS, setbuf() will only take 32-bit pointers, and a compilation
+ * with /POINTER_SIZE=64 will give off a MAYLOSEDATA2 warning here.
+ * However, we trust that the C RTL will never give us a FILE pointer
+ * above the first 4 GB of memory, so we simply turn off the warning
+ * temporarily.
+ */
+#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
+# pragma environment save
+# pragma message disable maylosedata2
+#endif
setbuf(fp, NULL);
+#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
+# pragma environment restore
+#endif
}
static const char *modestr(char mode, int format)