From: Eric Botcazou Date: Mon, 11 Jul 2016 07:41:11 +0000 (+0000) Subject: re PR ada/71817 (suspicious condition in C code) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=833c1dbc609404a69b30d7f045b50935c058302b;p=gcc.git 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f7fa41d5f65..21d61873404 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 67bdad3e8c5..e011fef46bd 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;