[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Redefinition of _FILE_OFFSET_BITS triggers an unusual amount of warning
From: |
Jonathan Blanchard |
Subject: |
Redefinition of _FILE_OFFSET_BITS triggers an unusual amount of warnings in Solaris. |
Date: |
Thu, 23 Apr 2009 13:01:50 -0300 |
hi,
Spurious redefinition of _FILE_OFFSET_BITS trigger many warnings when
using gcc in Solaris. Adding an undef before redefining would clear
the problem.
It is initially defined in
gcc/lib/gcc/i386-pc-solaris2.11/4.3.2/include-fixed/sys included by
string.h.
#if defined(_LP64)
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
#if _FILE_OFFSET_BITS - 0 != 64
#error "invalid _FILE_OFFSET_BITS value specified"
#endif
#else /* _LP64 */
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 32
#endif
#if _FILE_OFFSET_BITS - 0 != 32 && _FILE_OFFSET_BITS - 0 != 64
#error "invalid _FILE_OFFSET_BITS value specified"
#endif
#endif /* _LP64 */
And here is the result of the configure script on the subject :
configure:3376: checking for _FILE_OFFSET_BITS value needed for large files
configure:3411: gcc -c -g -O2 conftest.c >&5
conftest.c:14: warning: left shift count >= width of type
conftest.c:14: warning: left shift count >= width of type
conftest.c:16: error: size of array 'off_t_is_large' is negative
configure:3417: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Scilab"
| #define PACKAGE_TARNAME "scilab"
| #define PACKAGE_VERSION "5"
| #define PACKAGE_STRING "Scilab 5"
| #define PACKAGE_BUGREPORT "http://bugzilla.scilab.org/"
| /* end confdefs.h. */
| #include <sys/types.h>
| /* Check that off_t can represent 2**63 - 1 correctly.
| We can't simply define LARGE_OFF_T to be 9223372036854775807,
| since some C++ compilers masquerading as C compilers
| incorrectly reject 9223372036854775807. */
| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
| && LARGE_OFF_T % 2147483647 == 1)
| ? 1 : -1];
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3461: gcc -c -g -O2 conftest.c >&5
configure:3467: $? = 0
configure:3485: result: 64
Jonathan Blanchard
- Redefinition of _FILE_OFFSET_BITS triggers an unusual amount of warnings in Solaris.,
Jonathan Blanchard <=