about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/mips32
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-06-02 20:38:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-06-02 20:38:49 +0000
commite0c349b40c4f51589c2adb63ccdaaf4dcc0fb1ea (patch)
treeaf09f53a8011b770b7a71d917905d462125147c9 /sysdeps/unix/sysv/linux/mips/mips32
parent1769608794096c835095826559c0ba1555f43fc0 (diff)
downloadglibc-e0c349b40c4f51589c2adb63ccdaaf4dcc0fb1ea.tar.gz
glibc-e0c349b40c4f51589c2adb63ccdaaf4dcc0fb1ea.tar.xz
glibc-e0c349b40c4f51589c2adb63ccdaaf4dcc0fb1ea.zip
Use better variable names in MIPS syscall macros.
Carlos noted in
<https://sourceware.org/ml/libc-alpha/2015-05/msg00680.html> that
various ports use potentially problematic short variables names in
their syscall macros, which could shadow variables with the same name
from containing scopes.

This patch fixes variables called err and ret in MIPS macros.  (I left
result_var and _sys_result - separate variables in different macros,
which need separate names - alone.)

Tested for mips64 (all three ABIs) that installed stripped shared
libraries are unchanged by this patch.

	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (INLINE_SYSCALL):
	Use variable name _sc_err instead of err.
	[__mips16] (INTERNAL_SYSCALL_NCS): Use variable name _sc_ret
	instead of ret.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
	(INLINE_SYSCALL): Use variable name _sc_err instead of err.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
	(INLINE_SYSCALL): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/mips32')
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sysdep.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index e5025bad5b..a2aa38ddd7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -49,11 +49,11 @@
    call.  */
 #undef INLINE_SYSCALL
 #define INLINE_SYSCALL(name, nr, args...)                               \
-  ({ INTERNAL_SYSCALL_DECL(err);					\
-     long result_var = INTERNAL_SYSCALL (name, err, nr, args);		\
-     if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) )			\
+  ({ INTERNAL_SYSCALL_DECL (_sc_err);					\
+     long result_var = INTERNAL_SYSCALL (name, _sc_err, nr, args);	\
+     if ( INTERNAL_SYSCALL_ERROR_P (result_var, _sc_err) )		\
        {								\
-	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));	\
+	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, _sc_err));	\
 	 result_var = -1L;						\
        }								\
      result_var; })
@@ -111,10 +111,10 @@
 
 # define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\
 ({									\
-	union __mips16_syscall_return ret;				\
-	ret.val = __mips16_syscall##nr (args, number);			\
-	err = ret.reg.v1;						\
-	ret.reg.v0;							\
+	union __mips16_syscall_return _sc_ret;				\
+	_sc_ret.val = __mips16_syscall##nr (args, number);		\
+	err = _sc_ret.reg.v1;						\
+	_sc_ret.reg.v0;							\
 })
 
 # define INTERNAL_SYSCALL_MIPS16(number, err, nr, args...)		\