* stdlib/strtol.c: Optimize inner loop of long long versions.
1999-05-15 Ulrich Drepper <drepper@cygnus.com>
+ * stdlib/strtol.c: Optimize inner loop of long long versions.
+
* sysdeps/gnu/utmpx.h: Add needed type definitions according to
Unix98. Add forward declaration of struct utmp.
EGCS and gcc 2.8.1 shows this:
text data bss dec hex filename
-egcs-2.93.10 862897 15944 12824 891665 d9b11 libc.so
-gcc-2.8.1 959965 16468 12152 988585 f15a9 libc.so
+ egcs-2.93.10 862897 15944 12824 891665 d9b11 libc.so
+ gcc-2.8.1 959965 16468 12152 988585 f15a9 libc.so
Make up your own decision.
glibc will continue to use them. Other BSD versions seem to work correctly.
Until ypbind 3.4 is released, you can find a patch at
- ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc4.diff.gz
+ <ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc4.diff.gz>
2.14. Under Linux/Alpha, I always get "do_ypcall: clnt_call:
support and works directly with glibc 2.1. If you use gcc-2.8.1 with
libstdc++ 2.8.1.1, you need to modify libstdc++ a bit. A patch is available
as:
- ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz
+ <ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz>
Please note that libg++ 2.7.2 (and the Linux Versions 2.7.2.x) doesn't work
very well with the GNU C library due to vtable thunks. If you're upgrading
nss modules, and a few other files. Together, they should make it
possible to do development with old static libraries on a glibc 2.1
system. This add-on is still in development. You can get it from
- ftp://alpha.gnu.org/gnu/glibc-compat-2.1.tar.gz
+ <ftp://alpha.gnu.org/gnu/glibc-compat-2.1.tar.gz>
but please keep in mind that it is experimental.
stdin/stdout/stderr. Why?
{RM,AJ} Constructs like:
-static FILE *InPtr = stdin;
+ static FILE *InPtr = stdin;
lead to this message. This is correct behaviour with glibc since stdin is
not a constant expression. Please note that a strict reading of ISO C does
To fix those programs you've got to initialize the variable at run time.
This can be done, e.g. in main, like:
-static FILE *InPtr;
-int main(void)
-{
- InPtr = stdin;
-}
+ static FILE *InPtr;
+ int main(void)
+ {
+ InPtr = stdin;
+ }
or by constructors (beware this is gcc specific):
-static FILE *InPtr;
-static void inPtr_construct (void) __attribute__((constructor));
-static void inPtr_construct (void) { InPtr = stdin; }
+ static FILE *InPtr;
+ static void inPtr_construct (void) __attribute__((constructor));
+ static void inPtr_construct (void) { InPtr = stdin; }
3.10. I can't compile with gcc -traditional (or
{AJ} glibc2 does break -traditional and -traditonal-cpp - and will continue
to do so. For example constructs of the form:
-enum {foo
-#define foo foo
-}
+ enum {foo
+ #define foo foo
+ }
are useful for debugging purposes (you can use foo with your debugger that's
why we need the enum) and for compatibility (other systems use defines and
EGCS and gcc 2.8.1 shows this:
text data bss dec hex filename
-egcs-2.93.10 862897 15944 12824 891665 d9b11 libc.so
-gcc-2.8.1 959965 16468 12152 988585 f15a9 libc.so
+ egcs-2.93.10 862897 15944 12824 891665 d9b11 libc.so
+ gcc-2.8.1 959965 16468 12152 988585 f15a9 libc.so
Make up your own decision.
glibc will continue to use them. Other BSD versions seem to work correctly.
Until ypbind 3.4 is released, you can find a patch at
- ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc4.diff.gz
+ <ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc4.diff.gz>
?? Under Linux/Alpha, I always get "do_ypcall: clnt_call:
RPC: Unable to receive; errno = Connection refused" when using NIS.
support and works directly with glibc 2.1. If you use gcc-2.8.1 with
libstdc++ 2.8.1.1, you need to modify libstdc++ a bit. A patch is available
as:
- ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz
+ <ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz>
Please note that libg++ 2.7.2 (and the Linux Versions 2.7.2.x) doesn't work
very well with the GNU C library due to vtable thunks. If you're upgrading
nss modules, and a few other files. Together, they should make it
possible to do development with old static libraries on a glibc 2.1
system. This add-on is still in development. You can get it from
- ftp://alpha.gnu.org/gnu/glibc-compat-2.1.tar.gz
+ <ftp://alpha.gnu.org/gnu/glibc-compat-2.1.tar.gz>
but please keep in mind that it is experimental.
?? Why is extracting files via tar so slow?
stdin/stdout/stderr. Why?
{RM,AJ} Constructs like:
-static FILE *InPtr = stdin;
+ static FILE *InPtr = stdin;
lead to this message. This is correct behaviour with glibc since stdin is
not a constant expression. Please note that a strict reading of ISO C does
To fix those programs you've got to initialize the variable at run time.
This can be done, e.g. in main, like:
-static FILE *InPtr;
-int main(void)
-{
- InPtr = stdin;
-}
+ static FILE *InPtr;
+ int main(void)
+ {
+ InPtr = stdin;
+ }
or by constructors (beware this is gcc specific):
-static FILE *InPtr;
-static void inPtr_construct (void) __attribute__((constructor));
-static void inPtr_construct (void) { InPtr = stdin; }
+ static FILE *InPtr;
+ static void inPtr_construct (void) __attribute__((constructor));
+ static void inPtr_construct (void) { InPtr = stdin; }
?? I can't compile with gcc -traditional (or
{AJ} glibc2 does break -traditional and -traditonal-cpp - and will continue
to do so. For example constructs of the form:
-enum {foo
-#define foo foo
-}
+ enum {foo
+ #define foo foo
+ }
are useful for debugging purposes (you can use foo with your debugger that's
why we need the enum) and for compatibility (other systems use defines and
/* Convert string representation of a number into an integer value.
- Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,94,95,96,97,98,99 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
overflow = 0;
i = 0;
- for (c = *s; c != L_('\0'); c = *++s)
+ c = *s;
+ if (sizeof (long int) != sizeof (LONG int))
{
- if (s == end)
- break;
- if (c >= L_('0') && c <= L_('9'))
- c -= L_('0');
- else if (ISALPHA (c))
- c = TOUPPER (c) - L_('A') + 10;
- else
- break;
- if ((int) c >= base)
- break;
- /* Check for overflow. */
- if (i > cutoff || (i == cutoff && c > cutlim))
- overflow = 1;
- else
+ unsigned long int j = 0;
+
+ for (;c != L_('\0'); c = *++s)
{
- i *= (unsigned LONG int) base;
- i += c;
+ if (s == end)
+ break;
+ if (c >= L_('0') && c <= L_('9'))
+ c -= L_('0');
+ else if (ISALPHA (c))
+ c = TOUPPER (c) - L_('A') + 10;
+ else
+ break;
+ if ((int) c >= base)
+ break;
+ /* Note that we never can have an overflow. */
+ else
+ {
+ unsigned long int jj = j * (unsigned long int) base;
+ if (jj < j)
+ {
+ /* We have an overflow. Now use the long representation. */
+ i = (unsigned LONG int) j;
+ goto use_long;
+ }
+ j = jj;
+ j += c;
+ }
}
+
+ i = (unsigned LONG int) j;
}
+ else
+ for (;c != L_('\0'); c = *++s)
+ {
+ if (s == end)
+ break;
+ if (c >= L_('0') && c <= L_('9'))
+ c -= L_('0');
+ else if (ISALPHA (c))
+ c = TOUPPER (c) - L_('A') + 10;
+ else
+ break;
+ if ((int) c >= base)
+ break;
+ /* Check for overflow. */
+ if (i > cutoff || (i == cutoff && c > cutlim))
+ overflow = 1;
+ else
+ {
+ use_long:
+ i *= (unsigned LONG int) base;
+ i += c;
+ }
+ }
/* Check if anything actually happened. */
if (s == save)