[PATCH] Fix getconf LFS_CFLAGS on 64bit arches
Jakub Jelinek
jakub@redhat.com
Mon Apr 30 01:27:00 GMT 2001
Hi!
Addition of _CS_V6_WIDTH_RESTRICTED_ENVS broke getconf LFS_CFLAGS on
__WORDSIZE==64 targets because the case used to fall through to the
string=""; string_len = 1; cases, while now getconf LFS_CFLAGS returns
_POSIX_V6_LP64_OFF64. I believe a FALLTHROUGH comment should be sufficient
to protect this from future breakages, though adding
#else
string = "";
string_len = 1;
break;
before _CS_LFS_CFLAGS's #endif is certainly an option as well (the compiler
should merge the two identical case handlers anyway).
2001-04-30 Jakub Jelinek <jakub@redhat.com>
* posix/confstr.c (confstr) [_CS_V6_WIDTH_RESTRICTED_ENVS]: Move so
that _CS_LFS_CFLAGS can fall through to the empty returned string
case. Add FALLTHROUGH comment.
--- libc/posix/confstr.c.jj Wed Apr 25 12:39:49 2001
+++ libc/posix/confstr.c Mon Apr 30 11:30:11 2001
@@ -44,19 +44,6 @@ confstr (name, buf, len)
}
break;
- case _CS_XBS5_ILP32_OFFBIG_CFLAGS:
- case _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS:
- case _CS_LFS_CFLAGS:
-#if _XBS5_LP64_OFF64 == -1 && _XBS5_LPBIG_OFFBIG == -1 && _XBS5_ILP32_OFFBIG == 1
- /* Signal that we want the new ABI. */
- {
- static const char file_offset[] = "-D_FILE_OFFSET_BITS=64";
- string = file_offset;
- string_len = sizeof (file_offset);
- }
- break;
-#endif
-
case _CS_V6_WIDTH_RESTRICTED_ENVS:
/* We have to return a newline-separated list of named of
programming environements in which the widths of blksize_t,
@@ -94,6 +81,20 @@ confstr (name, buf, len)
string_len = sizeof (restenvs);
}
break;
+
+ case _CS_XBS5_ILP32_OFFBIG_CFLAGS:
+ case _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS:
+ case _CS_LFS_CFLAGS:
+#if _XBS5_LP64_OFF64 == -1 && _XBS5_LPBIG_OFFBIG == -1 && _XBS5_ILP32_OFFBIG == 1
+ /* Signal that we want the new ABI. */
+ {
+ static const char file_offset[] = "-D_FILE_OFFSET_BITS=64";
+ string = file_offset;
+ string_len = sizeof (file_offset);
+ }
+ break;
+#endif
+ /* FALLTHROUGH */
case _CS_LFS_LINTFLAGS:
case _CS_LFS_LDFLAGS:
Jakub
More information about the Libc-hacker
mailing list