* Use __extension__ with long long in installed headers
@ 2013-01-10 17:32 Joseph S. Myers
2013-01-10 17:41 ` Roland McGrath
2013-01-10 19:20 ` Mike Frysinger
0 siblings, 2 replies; 4+ messages in thread
From: Joseph S. Myers @ 2013-01-10 17:32 UTC (permalink / raw)
To: libc-alpha; +Cc: libc-ports
This patch makes installed headers use __extension__ with long long in
all the places I found where it was missing, in support of working
with -std=c89 -pedantic -Wsystem-headers.
Tested x86_64.
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* elf/link.h (struct dl_phdr_info): Use __extension__ with long
long.
* math/bits/mathcalls.h (llrint): Likewise.
(llround): Likewise.
* stdlib/stdlib.h (struct drand48_data): Likewise.
* sysdeps/generic/inttypes.h (imaxdiv_t): Likewise.
* sysdeps/s390/bits/byteswap.h (__bswap_64): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/ipc.h (struct ipc_perm):
Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (struct fpu):
Likewise.
* sysdeps/unix/sysv/linux/x86/sys/procfs.h [__x86_64__]
(elf_greg_t): Likewise.
* sysdeps/x86/bits/setjmp.h [__x86_64__ && __WORDSIZE != 64]
(__jmp_buf): Likewise.
* sysdeps/x86/fpu/bits/mathinline.h (llrintf): Likewise, for all
definitions.
(llrint): Likewise, for all definitions.
(llrintl): Likewise.
ports/ChangeLog.aarch64:
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/aarch64/bits/setjmp.h (__jmp_buf): Use __extension__
with long long.
ports/ChangeLog.hppa:
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/hppa/fpu/fpu_control.h (_FPU_GETCW): Use __extension__
with long long.
(_FPU_SETCW): Likewise.
* sysdeps/unix/sysv/linux/hppa/bits/ipc.h (struct ipc_perm):
Likewise.
ports/ChangeLog.m68k:
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/m68k/bits/byteswap.h (__bswap_64): Use __extension__
with long long.
ports/ChangeLog.mips:
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h (struct
sigcontext): Use __extension__ with long long in all definitions.
diff --git a/elf/link.h b/elf/link.h
index 29e7ced..500871f 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -147,9 +147,9 @@ struct dl_phdr_info
whether or not each later member is available. */
/* Incremented when a new object may have been added. */
- unsigned long long int dlpi_adds;
+ __extension__ unsigned long long int dlpi_adds;
/* Incremented when an object may have been removed. */
- unsigned long long int dlpi_subs;
+ __extension__ unsigned long long int dlpi_subs;
/* If there is a PT_TLS segment, its module ID as used in
TLS relocations, else zero. */
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 41b1367..e90a34b 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -323,11 +323,13 @@ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
/* Round X to nearest integral value according to current rounding
direction. */
__MATHDECL (long int,lrint,, (_Mdouble_ __x));
+__extension__
__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
/* Round X to nearest integral value, rounding halfway cases away from
zero. */
__MATHDECL (long int,lround,, (_Mdouble_ __x));
+__extension__
__MATHDECL (long long int,llround,, (_Mdouble_ __x));
diff --git a/ports/sysdeps/aarch64/bits/setjmp.h b/ports/sysdeps/aarch64/bits/setjmp.h
index 6d78b7e..6a93e0a 100644
--- a/ports/sysdeps/aarch64/bits/setjmp.h
+++ b/ports/sysdeps/aarch64/bits/setjmp.h
@@ -27,7 +27,7 @@
/* Jump buffer contains:
x19-x28, x29(fp), x30(lr), (x31)sp, d8-d15. Other registers are not
saved. */
-typedef unsigned long long __jmp_buf [22];
+__extension__ typedef unsigned long long __jmp_buf [22];
#endif
#endif
diff --git a/ports/sysdeps/hppa/fpu/fpu_control.h b/ports/sysdeps/hppa/fpu/fpu_control.h
index 7aa16c9..5cac334 100644
--- a/ports/sysdeps/hppa/fpu/fpu_control.h
+++ b/ports/sysdeps/hppa/fpu/fpu_control.h
@@ -44,7 +44,7 @@ typedef unsigned int fpu_control_t;
/* Macros for accessing the hardware control word. */
#define _FPU_GETCW(cw) \
({ \
- union { unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
+ union { __extension__ unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
/* Get the current status word. */ \
__asm__ ("fstd %%fr0,0(%1)\n\t" \
"fldd 0(%1),%%fr0\n\t" \
@@ -54,7 +54,7 @@ typedef unsigned int fpu_control_t;
#define _FPU_SETCW(cw) \
({ \
- union { unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
+ union { __extension__ unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
__fullfp.__halfreg[0] = cw; \
__asm__ ("fldd 0(%1),%%fr0\n\t" \
: : "m" (__fullfp.__fpreg), "r" (__fullfp.__fpreg) : "%r0" ); \
diff --git a/ports/sysdeps/m68k/bits/byteswap.h b/ports/sysdeps/m68k/bits/byteswap.h
index 4e4dd23..9f0a7b7 100644
--- a/ports/sysdeps/m68k/bits/byteswap.h
+++ b/ports/sysdeps/m68k/bits/byteswap.h
@@ -74,6 +74,7 @@ __bswap_32 (unsigned int __bsx)
| (((x) & 0x00000000000000ffull) << 56))
/* Swap bytes in 64 bit value. */
+__extension__
static __inline unsigned long long
__bswap_64 (unsigned long long __bsx)
{
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
index bc07c1f..04a75e2 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
@@ -57,6 +57,6 @@ struct ipc_perm
#endif
unsigned short int __seq; /* Sequence number. */
unsigned int __pad3;
- unsigned long long int __unused1;
- unsigned long long int __unused2;
+ __extension__ unsigned long long int __unused1;
+ __extension__ unsigned long long int __unused2;
};
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
index 085a00d..f3c5180 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
@@ -39,16 +39,16 @@
struct sigcontext {
unsigned int sc_regmask;
unsigned int sc_status;
- unsigned long long sc_pc;
- unsigned long long sc_regs[32];
- unsigned long long sc_fpregs[32];
+ __extension__ unsigned long long sc_pc;
+ __extension__ unsigned long long sc_regs[32];
+ __extension__ unsigned long long sc_fpregs[32];
unsigned int sc_ownedfp;
unsigned int sc_fpc_csr;
unsigned int sc_fpc_eir;
unsigned int sc_used_math;
unsigned int sc_dsp;
- unsigned long long sc_mdhi;
- unsigned long long sc_mdlo;
+ __extension__ unsigned long long sc_mdhi;
+ __extension__ unsigned long long sc_mdlo;
unsigned long sc_hi1;
unsigned long sc_lo1;
unsigned long sc_hi2;
@@ -61,17 +61,17 @@ struct sigcontext {
/* This structure changed in 2.6.12-rc4 when DSP support was added. */
struct sigcontext {
- unsigned long long sc_regs[32];
- unsigned long long sc_fpregs[32];
- unsigned long long sc_mdhi;
- unsigned long long sc_hi1;
- unsigned long long sc_hi2;
- unsigned long long sc_hi3;
- unsigned long long sc_mdlo;
- unsigned long long sc_lo1;
- unsigned long long sc_lo2;
- unsigned long long sc_lo3;
- unsigned long long sc_pc;
+ __extension__ unsigned long long sc_regs[32];
+ __extension__ unsigned long long sc_fpregs[32];
+ __extension__ unsigned long long sc_mdhi;
+ __extension__ unsigned long long sc_hi1;
+ __extension__ unsigned long long sc_hi2;
+ __extension__ unsigned long long sc_hi3;
+ __extension__ unsigned long long sc_mdlo;
+ __extension__ unsigned long long sc_lo1;
+ __extension__ unsigned long long sc_lo2;
+ __extension__ unsigned long long sc_lo3;
+ __extension__ unsigned long long sc_pc;
unsigned int sc_fpc_csr;
unsigned int sc_used_math;
unsigned int sc_dsp;
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 6bf708a..41fb7e7 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -415,7 +415,8 @@ struct drand48_data
unsigned short int __old_x[3]; /* Old state. */
unsigned short int __c; /* Additive const. in congruential formula. */
unsigned short int __init; /* Flag for initializing. */
- unsigned long long int __a; /* Factor in congruential formula. */
+ __extension__ unsigned long long int __a; /* Factor in congruential
+ formula. */
};
/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
diff --git a/sysdeps/generic/inttypes.h b/sysdeps/generic/inttypes.h
index 47fe751..dc97519 100644
--- a/sysdeps/generic/inttypes.h
+++ b/sysdeps/generic/inttypes.h
@@ -286,8 +286,8 @@ typedef struct
/* We have to define the `uintmax_t' type using `lldiv_t'. */
typedef struct
{
- long long int quot; /* Quotient. */
- long long int rem; /* Remainder. */
+ __extension__ long long int quot; /* Quotient. */
+ __extension__ long long int rem; /* Remainder. */
} imaxdiv_t;
#endif
diff --git a/sysdeps/s390/bits/byteswap.h b/sysdeps/s390/bits/byteswap.h
index 6f96257..9221ea2 100644
--- a/sysdeps/s390/bits/byteswap.h
+++ b/sysdeps/s390/bits/byteswap.h
@@ -123,6 +123,7 @@ __bswap_32 (unsigned int __bsx)
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56))
+__extension__
static __inline unsigned long long int
__bswap_64 (unsigned long long int __bsx)
{
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/ipc.h b/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
index 757d047..e59f96a 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
@@ -56,6 +56,6 @@ struct ipc_perm
unsigned short int __pad1;
#endif
unsigned short int __seq; /* Sequence number. */
- unsigned long long int __unused1;
- unsigned long long int __unused2;
+ __extension__ unsigned long long int __unused1;
+ __extension__ unsigned long long int __unused2;
};
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
index 74c7291..1a3d4b5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
@@ -217,7 +217,7 @@ typedef struct fpu
typedef struct fpu
{
union { /* FPU floating point regs */
- unsigned long long fpu_regs[32]; /* 32 singles */
+ __extension__ unsigned long long fpu_regs[32]; /* 32 singles */
double fpu_dregs[16]; /* 16 doubles */
} fpu_fr;
struct fq *fpu_q; /* ptr to array of FQ entries */
diff --git a/sysdeps/unix/sysv/linux/x86/sys/procfs.h b/sysdeps/unix/sysv/linux/x86/sys/procfs.h
index dddbced..ec318ad 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/procfs.h
@@ -36,7 +36,7 @@ __BEGIN_DECLS
/* Type for a general-purpose register. */
#ifdef __x86_64__
-typedef unsigned long long elf_greg_t;
+__extension__ typedef unsigned long long elf_greg_t;
#else
typedef unsigned long elf_greg_t;
#endif
diff --git a/sysdeps/x86/bits/setjmp.h b/sysdeps/x86/bits/setjmp.h
index 8a7e5dc..7c666e2 100644
--- a/sysdeps/x86/bits/setjmp.h
+++ b/sysdeps/x86/bits/setjmp.h
@@ -30,7 +30,7 @@
# if __WORDSIZE == 64
typedef long int __jmp_buf[8];
# elif defined __x86_64__
-typedef long long int __jmp_buf[8];
+__extension__ typedef long long int __jmp_buf[8];
# else
typedef int __jmp_buf[6];
# endif
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index 838c13c..fed6414 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -198,6 +198,7 @@ __NTH (lrint (double __x))
}
# endif
# ifdef __x86_64__
+__extension__
__MATH_INLINE long long int
__NTH (llrintf (float __x))
{
@@ -209,6 +210,7 @@ __NTH (llrintf (float __x))
__asm __volatile__ ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
return __res;
}
+__extension__
__MATH_INLINE long long int
__NTH (llrint (double __x))
{
@@ -896,16 +898,19 @@ __NTH (lrintl (long double __x))
("fistpll %0" \
: "=m" (__llrintres) : "t" (__x) : "st"); \
return __llrintres
+__extension__
__MATH_INLINE long long int
__NTH (llrintf (float __x))
{
__llrint_code;
}
+__extension__
__MATH_INLINE long long int
__NTH (llrint (double __x))
{
__llrint_code;
}
+__extension__
__MATH_INLINE long long int
__NTH (llrintl (long double __x))
{
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use __extension__ with long long in installed headers
2013-01-10 17:32 Use __extension__ with long long in installed headers Joseph S. Myers
@ 2013-01-10 17:41 ` Roland McGrath
2013-01-10 19:20 ` Mike Frysinger
1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2013-01-10 17:41 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: libc-alpha, libc-ports
That looks fine. But many places would do better to use __uint64_t.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use __extension__ with long long in installed headers
2013-01-10 17:32 Use __extension__ with long long in installed headers Joseph S. Myers
2013-01-10 17:41 ` Roland McGrath
@ 2013-01-10 19:20 ` Mike Frysinger
2013-01-10 20:21 ` Joseph S. Myers
1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2013-01-10 19:20 UTC (permalink / raw)
To: libc-alpha; +Cc: Joseph S. Myers, libc-ports
[-- Attachment #1: Type: Text/Plain, Size: 372 bytes --]
On Thursday 10 January 2013 12:32:09 Joseph S. Myers wrote:
> This patch makes installed headers use __extension__ with long long in
> all the places I found where it was missing, in support of working
> with -std=c89 -pedantic -Wsystem-headers.
is there a script for running on installed headers to prevent regressions ? i
didn't see one in scripts/ ...
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use __extension__ with long long in installed headers
2013-01-10 19:20 ` Mike Frysinger
@ 2013-01-10 20:21 ` Joseph S. Myers
0 siblings, 0 replies; 4+ messages in thread
From: Joseph S. Myers @ 2013-01-10 20:21 UTC (permalink / raw)
To: Mike Frysinger; +Cc: libc-alpha, libc-ports
On Thu, 10 Jan 2013, Mike Frysinger wrote:
> On Thursday 10 January 2013 12:32:09 Joseph S. Myers wrote:
> > This patch makes installed headers use __extension__ with long long in
> > all the places I found where it was missing, in support of working
> > with -std=c89 -pedantic -Wsystem-headers.
>
> is there a script for running on installed headers to prevent regressions ? i
> didn't see one in scripts/ ...
There is no such script and I found these issues by examining headers in
the source tree and ignoring cases that already used __extension__ or were
not installed, not based on installed headers or running the compiler.
See the todo list and
<http://sourceware.org/ml/libc-alpha/2013-01/msg00358.html> regarding what
should be tested by such a script.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-10 20:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 17:32 Use __extension__ with long long in installed headers Joseph S. Myers
2013-01-10 17:41 ` Roland McGrath
2013-01-10 19:20 ` Mike Frysinger
2013-01-10 20:21 ` Joseph S. Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).