This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: 64bit alpha cleanups for glibc 2.1.3
- To: Brad Lucier <lucier at math dot purdue dot edu>
- Subject: Re: 64bit alpha cleanups for glibc 2.1.3
- From: Andreas Jaeger <aj at suse dot de>
- Date: 23 May 2000 08:44:30 +0200
- Cc: libc-alpha at sourceware dot cygnus dot com
- References: <200002291934.OAA15294@polya.math.purdue.edu>
Hi Brad,
sorry for the late reply. I'm not going to add this to glibc 2.1.3
but to 2.2, the next major release. The code there already contains a
number of fixes - and indeed everything you reported seems to have
been fixed in the meantime.
>>>>> Brad Lucier writes:
> I built glibc with a current gcc-2.96 snapshot and got some warnings, some
> of which indicate errors, I believe. I fixed some of them as indicated.
> I'll list nearly all the warnings from the build, separated into ones that I
> didn't change (because I couldn't figure out how to fix it) and things I did
> change:
> Didn't change:
[...]
> Changed (diffs are below):
> mbtowc.c: In function `mbtowc':
> mbtowc.c:51: warning: type mismatch in implicit declaration for built-in function `memset'
> wctomb.c: In function `wctomb':
> wctomb.c:47: warning: type mismatch in implicit declaration for built-in function `memset'
> mntent_r.c: In function `__addmntent':
> mntent_r.c:214: warning: type mismatch in implicit declaration for built-in function `alloca'
> gconv_open.c: In function `__gconv_open':
> gconv_open.c:52: warning: type mismatch in implicit declaration for built-in function `memset'
> dl-runtime.c: In function `fixup':
> dl-runtime.c:64: warning: type mismatch in implicit declaration for built-in function `alloca'
> lock/lock_region.c: In function `__lock_dump_region':
> lock/lock_region.c:635: warning: cast from pointer to integer of different size
> lock/lock_region.c:643: warning: cast from pointer to integer of different size
db2 will not be part of glibc 2.2 - the patch is therefore not needed.
> programs/localedef.c: In function `construct_output_path':
> programs/localedef.c:499: warning: field width is not type int (arg 4)
> connections.c: In function `nscd_run':
> connections.c:386: warning: cast from pointer to integer of different size
> connections.c: In function `start_threads':
> connections.c:512: warning: cast to pointer from integer of different size
> sprof.c: In function `generate_call_graph':
> sprof.c:1214: warning: field width is not type int (arg 2)
[...]
> ===================================================================
> RCS file: RCS/dl-runtime.c,v
> retrieving revision 1.1
> diff -c -r1.1 dl-runtime.c
> *** dl-runtime.c 2000/02/29 18:24:49 1.1
> --- dl-runtime.c 2000/02/29 19:24:57
> ***************
> *** 18,23 ****
> --- 18,24 ----
> Boston, MA 02111-1307, USA. */
> #include <unistd.h>
> + #include <stdlib.h>
We've included <alloca.h> already which should also fix the problem.
> #include <elf/ldsodefs.h>
> #include "dynamic-link.h"
> ===================================================================
> RCS file: RCS/sprof.c,v
> retrieving revision 1.1
> diff -c -r1.1 sprof.c
> *** sprof.c 2000/02/29 19:07:26 1.1
> --- sprof.c 2000/02/29 19:17:58
> ***************
> *** 1206,1212 ****
> /* Info abount the function itself. */
> n = printf ("[%Zu]", cnt);
> printf ("%*s%5.1f%8.2f%8.2f%9" PRIdMAX " %s [%Zd]\n",
> ! 7 - n, " ",
> total_ticks ? (100.0 * sortsym[cnt]->ticks) / total_ticks : 0,
> sortsym[cnt]->ticks * tick_unit,
> 0.0, /* FIXME: what's time for the children, recursive */
> --- 1206,1212 ----
> /* Info abount the function itself. */
> n = printf ("[%Zu]", cnt);
> printf ("%*s%5.1f%8.2f%8.2f%9" PRIdMAX " %s [%Zd]\n",
> ! (int) (7 - n), " ",
Somebody else did this already.
> total_ticks ? (100.0 * sortsym[cnt]->ticks) / total_ticks : 0,
> sortsym[cnt]->ticks * tick_unit,
> 0.0, /* FIXME: what's time for the children, recursive */
> ===================================================================
> RCS file: RCS/gconv_open.c,v
> retrieving revision 1.1
> diff -c -r1.1 gconv_open.c
> *** gconv_open.c 2000/02/29 18:13:19 1.1
> --- gconv_open.c 2000/02/29 19:23:49
> ***************
> *** 20,25 ****
> --- 20,26 ----
> #include <errno.h>
> #include <stdlib.h>
> + #include <string.h>
Already done.
> #include <gconv_int.h>
> ===================================================================
> RCS file: RCS/mntent_r.c,v
> retrieving revision 1.1
> diff -c -r1.1 mntent_r.c
> *** mntent_r.c 2000/02/29 18:09:59 1.1
> --- mntent_r.c 2000/02/29 19:22:42
> ***************
> *** 21,26 ****
> --- 21,27 ----
> #include <stdio.h>
> #include <string.h>
> #include <sys/types.h>
> + #include <stdlib.h>
<alloca.h> has been included instead.
> #ifdef USE_IN_LIBIO
> # define flockfile(s) _IO_flockfile (s)
> ===================================================================
> RCS file: RCS/connections.c,v
> retrieving revision 1.1
> diff -c -r1.1 connections.c
> *** connections.c 2000/02/29 19:04:11 1.1
> --- connections.c 2000/02/29 19:06:46
> ***************
> *** 383,389 ****
> __attribute__ ((__noreturn__))
> nscd_run (void *p)
> {
> ! int my_number = (int) p;
> struct pollfd conn;
> int run_prune = my_number < lastdb && dbs[my_number].enabled;
> time_t now = time (NULL);
> --- 383,389 ----
> __attribute__ ((__noreturn__))
> nscd_run (void *p)
> {
> ! long int my_number = (long int) p;
Fixed already.
> struct pollfd conn;
> int run_prune = my_number < lastdb && dbs[my_number].enabled;
> time_t now = time (NULL);
> ***************
> *** 497,503 ****
> void
> start_threads (void)
> {
> ! int i;
> pthread_attr_t attr;
> pthread_t th;
> --- 497,503 ----
> void
> start_threads (void)
> {
> ! long int i;
Fixed already.
> pthread_attr_t attr;
> pthread_t th;
> ===================================================================
> RCS file: RCS/mbtowc.c,v
> retrieving revision 1.1
> diff -c -r1.1 mbtowc.c
> *** mbtowc.c 2000/02/29 18:04:22 1.1
> --- mbtowc.c 2000/02/29 19:21:02
> ***************
> *** 20,25 ****
> --- 20,26 ----
> #include <wchar.h>
> #include <gconv.h>
> #include <wcsmbs/wcsmbsload.h>
> + #include <string.h>
Already done.
> /* Common state for all non-restartable conversion functions. */
> ***************
> *** 48,54 ****
> /* This is an extension in the Unix standard which does not directly
> violate ISO C. */
> ! memset (&__no_r_state, '\0', sizeof __no_r_state);
> result = __wcsmbs_gconv_fcts.towc->stateful;
> }
> --- 49,55 ----
> /* This is an extension in the Unix standard which does not directly
> violate ISO C. */
> ! memset (&__no_r_state, (int) '\0', sizeof __no_r_state);
> result = __wcsmbs_gconv_fcts.towc->stateful;
> }
> ===================================================================
> RCS file: RCS/wctomb.c,v
> retrieving revision 1.1
> diff -c -r1.1 wctomb.c
> *** wctomb.c 2000/02/29 18:04:46 1.1
> --- wctomb.c 2000/02/29 19:21:18
> ***************
> *** 20,25 ****
> --- 20,26 ----
> #include <wchar.h>
> #include <gconv.h>
> #include <wcsmbs/wcsmbsload.h>
> + #include <string.h>
Already done.
> extern mbstate_t __no_r_state; /* Defined in mbtowc.c. */
> ***************
> *** 44,50 ****
> /* This is an extension in the Unix standard which does not directly
> violate ISO C. */
> ! memset (&__no_r_state, '\0', sizeof __no_r_state);
> return __wcsmbs_gconv_fcts.tomb->stateful;
> }
> --- 45,51 ----
> /* This is an extension in the Unix standard which does not directly
> violate ISO C. */
> ! memset (&__no_r_state, (int) '\0', sizeof __no_r_state);
This shouldn't be needed.
> return __wcsmbs_gconv_fcts.tomb->stateful;
> }
Please send patches together with a ChangeLog entry.
Thanks,
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de