[patch] warning cleanup
Richard Henderson
rth@twiddle.net
Mon Mar 20 12:40:00 GMT 2000
Mostly 64-bit stuff, but also a couple other cvs-gcc nits.
Ok?
r~
* locale/programs/ld-collate.c (collate_read): Don't cast string
to int.
* nis/nss_nis/nis-service.c (_nss_nis_getservbyport_r): Last
argument to yperr2nss is an int, not size_t.
* posix/regex.c (print_partial_compiled_pattern): Cast all
ptrdiff_t to long for printing.
(print_compiled_pattern): Use Z for printing size_t.
* posix/testfnm.c (tests): Avoid trigraphs.
* sysdeps/alpha/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE):
Use a C comment, not an assembly comment.
* sysdeps/unix/sysv/linux/alpha/msgctl.c: Clarify use
of __ASSUME_32BITUIDS.
Index: locale/programs/ld-collate.c
===================================================================
RCS file: /cvs/glibc/libc/locale/programs/ld-collate.c,v
retrieving revision 1.64
diff -u -p -d -r1.64 ld-collate.c
--- ld-collate.c 2000/03/15 03:28:54 1.64
+++ ld-collate.c 2000/03/20 20:01:45
@@ -3393,7 +3393,7 @@ error while adding equivalent collating
lr_error (ldfile,
_("%s: order for `%.*s' already defined at %s:%zu"),
"LC_COLLATE", 9, "UNDEFINED",
- (int) collate->undefined.file,
+ collate->undefined.file,
collate->undefined.line);
lr_ignore_rest (ldfile, 0);
}
Index: nis/nss_nis/nis-service.c
===================================================================
RCS file: /cvs/glibc/libc/nis/nss_nis/nis-service.c,v
retrieving revision 1.15
diff -u -p -d -r1.15 nis-service.c
--- nis-service.c 2000/03/17 18:34:12 1.15
+++ nis-service.c 2000/03/20 20:01:46
@@ -325,6 +325,7 @@ _nss_nis_getservbyport_r (int port, char
char key[100 + strlen (protocol) + 2];
char *domain, *result;
size_t keylen, len;
+ int int_len;
/* If this fails, the other solution will also fail. */
if (yp_get_default_domain (&domain))
@@ -333,7 +334,8 @@ _nss_nis_getservbyport_r (int port, char
/* key is: "port/protocol" */
keylen = snprintf (key, sizeof (key), "%d/%s", port, protocol);
status = yperr2nss (yp_match (domain, "services.byname", key,
- keylen, &result, &len));
+ keylen, &result, &int_len));
+ len = int_len;
/* If we found the key, it's ok and parse the result. If not,
fall through and parse the complete table. */
Index: posix/regex.c
===================================================================
RCS file: /cvs/glibc/libc/posix/regex.c,v
retrieving revision 1.70
diff -u -p -d -r1.70 regex.c
--- regex.c 2000/03/03 21:02:31 1.70
+++ regex.c 2000/03/20 20:01:48
@@ -691,7 +691,7 @@ print_partial_compiled_pattern (start, e
/* Loop over pattern commands. */
while (p < pend)
{
- printf ("%d:\t", p - start);
+ printf ("%ld:\t", (long) (p - start));
switch ((re_opcode_t) *p++)
{
@@ -781,17 +781,18 @@ print_partial_compiled_pattern (start, e
case on_failure_jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/on_failure_jump to %d", p + mcnt - start);
+ printf ("/on_failure_jump to %ld", (long)(p + mcnt - start));
break;
case on_failure_keep_string_jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
+ printf ("/on_failure_keep_string_jump to %ld",
+ (long)(p + mcnt - start));
break;
case dummy_failure_jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/dummy_failure_jump to %d", p + mcnt - start);
+ printf ("/dummy_failure_jump to %ld", (long)(p + mcnt - start));
break;
case push_dummy_failure:
@@ -800,43 +801,44 @@ print_partial_compiled_pattern (start, e
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/maybe_pop_jump to %d", p + mcnt - start);
+ printf ("/maybe_pop_jump to %ld", (long)(p + mcnt - start));
break;
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/pop_failure_jump to %d", p + mcnt - start);
+ printf ("/pop_failure_jump to %ld", (long)(p + mcnt - start));
break;
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
- printf ("/jump_past_alt to %d", p + mcnt - start);
+ printf ("/jump_past_alt to %ld", (long)(p + mcnt - start));
break;
case jump:
extract_number_and_incr (&mcnt, &p);
- printf ("/jump to %d", p + mcnt - start);
+ printf ("/jump to %ld", (long)(p + mcnt - start));
break;
case succeed_n:
extract_number_and_incr (&mcnt, &p);
p1 = p + mcnt;
extract_number_and_incr (&mcnt2, &p);
- printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
+ printf ("/succeed_n to %ld, %d times", (long)(p1 - start), mcnt2);
break;
case jump_n:
extract_number_and_incr (&mcnt, &p);
p1 = p + mcnt;
extract_number_and_incr (&mcnt2, &p);
- printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
+ printf ("/jump_n to %ld, %d times", (long)(p1 - start), mcnt2);
break;
case set_number_at:
extract_number_and_incr (&mcnt, &p);
p1 = p + mcnt;
extract_number_and_incr (&mcnt2, &p);
- printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
+ printf ("/set_number_at location %ld to %d",
+ (long)(p1 - start), mcnt2);
break;
case wordbound:
@@ -903,7 +905,7 @@ print_partial_compiled_pattern (start, e
putchar ('\n');
}
- printf ("%d:\tend of pattern.\n", p - start);
+ printf ("%ld:\tend of pattern.\n", (long)(p - start));
}
@@ -923,7 +925,7 @@ print_compiled_pattern (bufp)
print_fastmap (bufp->fastmap);
}
- printf ("re_nsub: %d\t", bufp->re_nsub);
+ printf ("re_nsub: %Zd\t", bufp->re_nsub);
printf ("regs_alloc: %d\t", bufp->regs_allocated);
printf ("can_be_null: %d\t", bufp->can_be_null);
printf ("newline_anchor: %d\n", bufp->newline_anchor);
Index: posix/testfnm.c
===================================================================
RCS file: /cvs/glibc/libc/posix/testfnm.c,v
retrieving revision 1.9
diff -u -p -d -r1.9 testfnm.c
--- testfnm.c 2000/01/26 03:45:37 1.9
+++ testfnm.c 2000/03/20 20:01:48
@@ -28,9 +28,9 @@ struct {
{ "?/b", "\\?/b", 0, 0 },
{ "[/b", "[/b", 0, FNM_NOMATCH },
{ "[/b", "\\[/b", 0, 0 },
- { "aa/b", "??/b", 0, 0 },
- { "aa/b", "???b", 0, 0 },
- { "aa/b", "???b", FNM_PATHNAME, FNM_NOMATCH },
+ { "aa/b", "?""?/b", 0, 0 },
+ { "aa/b", "?""?""?b", 0, 0 },
+ { "aa/b", "?""?""?b", FNM_PATHNAME, FNM_NOMATCH },
{ ".a/b", "?a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
{ "a/.b", "a/?b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
{ ".a/b", "*a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
Index: sysdeps/alpha/dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/dl-machine.h,v
retrieving revision 1.36
diff -u -p -d -r1.36 dl-machine.h
--- dl-machine.h 1999/07/21 16:57:52 1.36
+++ dl-machine.h 2000/03/20 20:01:48
@@ -254,7 +254,7 @@ elf_machine_runtime_setup (struct link_m
#ifndef PROF
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup, imb); \
- TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup, #nop);
+ TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup, /* nop */);
#else
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup, imb); \
Index: sysdeps/unix/sysv/linux/alpha/msgctl.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/msgctl.c,v
retrieving revision 1.1
diff -u -p -d -r1.1 msgctl.c
--- msgctl.c 2000/02/11 21:00:09 1.1
+++ msgctl.c 2000/03/20 20:01:54
@@ -51,6 +51,9 @@ int __new_msgctl (int, int, struct msqid
int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
+ /* This is a misnomer -- Alpha had 32-bit uids at the beginning
+ of time. However, msg_qnum and msg_qbytes changed size at
+ the same time the size of uid changed elsewhere. */
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
#else
More information about the Libc-alpha
mailing list