From 833c1dbc609404a69b30d7f045b50935c058302b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 11 Jul 2016 07:41:11 +0000 Subject: [PATCH] re PR ada/71817 (suspicious condition in C code) PR ada/71817 * adaint.c (__gnat_is_read_accessible_file): Add parentheses. (__gnat_is_write_accessible_file): Likewise. From-SVN: r238204 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/adaint.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f7fa41d..21d6187 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2016-07-11 Eric Botcazou + + PR ada/71817 + * adaint.c (__gnat_is_read_accessible_file): Add parentheses. + (__gnat_is_write_accessible_file): Likewise. + 2016-07-07 Ed Schonberg * exp_ch6.adb (Expand_Internal_Init_Call): Subsidiary procedure diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 67bdad3..e011fef 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -1924,7 +1924,7 @@ __gnat_is_read_accessible_file (char *name) #elif defined (__vxworks) int fd; - if (fd = open (name, O_RDONLY, 0) < 0) + if ((fd = open (name, O_RDONLY, 0)) < 0) return 0; close (fd); return 1; @@ -1997,7 +1997,7 @@ __gnat_is_write_accessible_file (char *name) #elif defined (__vxworks) int fd; - if (fd = open (name, O_WRONLY, 0) < 0) + if ((fd = open (name, O_WRONLY, 0)) < 0) return 0; close (fd); return 1; -- 2.7.4