This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Avoid plain "aligned" attributes in installed headers


Installed headers should always use the forms of attributes with __
prefixes and suffixes, so __attribute__ ((__aligned__ (8))) instead of
the plain "aligned" form, to avoid taking identifiers from the user's
namespace.  (This isn't needed if the attribute is already a keyword
such as "const".)

I propose this patch to fix the instances I found - could the powerpc
and s390 maintainers review it?  (Although the headers in question
hardly keep a particularly clean namespace anyway, they have no need
to take this particular identifier.)  Mike, Carlos, Chris: you'll want
to fix similar instances in ports
(sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
sysdeps/unix/sysv/linux/generic/bits/stat.h
sysdeps/unix/sysv/linux/generic/bits/statfs.h).

(I have not tested this patch.)

2012-05-14  Joseph Myers  <joseph@codesourcery.com>

	[BZ #14109]
	* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h (elf_vrreg_t): Use
	__aligned__ in attribute.
	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h (__psw_t): Likewise.
	(gregset_t): Likewise.

diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h b/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
index 146b28e..dc41bdf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999, 2002, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -52,7 +52,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 /* Altivec registers */
 typedef struct {
   unsigned int u[4];
-} __attribute__ ((aligned (16))) elf_vrreg_t;
+} __attribute__ ((__aligned__ (16))) elf_vrreg_t;
 typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
index 5dd0234..e66854d 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
    Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -33,7 +33,7 @@ typedef struct
 {
   unsigned long mask;
   unsigned long addr;
-} __attribute__ ((aligned(8))) __psw_t;
+} __attribute__ ((__aligned__(8))) __psw_t;
 
 /* Type for a general-purpose register.  */
 typedef unsigned long greg_t;
@@ -49,7 +49,7 @@ typedef unsigned long greg_t;
 # define NGREG 36
 #endif
 /* Must match kernels psw_t alignment.  */
-typedef greg_t gregset_t[NGREG] __attribute__ ((aligned(8)));
+typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
 
 typedef union
   {

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]