This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][ada][PR65490] Fix bzero warning in child_setup_tty
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Arnaud Charlet <charlet at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2015 15:59:18 +0200
- Subject: [PATCH][ada][PR65490] Fix bzero warning in child_setup_tty
- Authentication-results: sourceware.org; auth=none
Hi,
This patch fixes the warning:
...
terminals.c:1266:21: warning: argument to âsizeofâ in âbzeroâ call is the same
expression as the destination; did you mean to remove the addressof?
[-Wsizeof-pointer-memaccess]
...
bootstrapped and reg-tested on x86_64.
OK for stage 4/stage1?
Thanks,
- Tom
Fix bzero warning in child_setup_tty
2015-03-30 Tom de Vries <tom@codesourcery.com>
PR ada/65490
* terminals.c (child_setup_tty): Fix warning 'argument to sizeof in
bzero call is the same expression as the destination'.
---
gcc/ada/terminals.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index a46e610..eaaf1c2 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1262,8 +1262,8 @@ child_setup_tty (int fd)
struct termios s;
int status;
- /* ensure that s is filled with 0 */
- bzero (&s, sizeof (&s));
+ /* Ensure that s is filled with 0. */
+ bzero (&s, sizeof (s));
/* Get the current terminal settings */
status = tcgetattr (fd, &s);
--
1.9.1