am cb0f5ed8: am 50ace4fe: Remove compiler warnings when building Bionic.

Merge commit 'cb0f5ed8111d4305cf6798aefdb4f9623570c83a'

* commit 'cb0f5ed8111d4305cf6798aefdb4f9623570c83a':
  Remove compiler warnings when building Bionic.
This commit is contained in:
David 'Digit' Turner 2010-06-23 12:41:50 -07:00 committed by Android Git Automerger
commit cb43ffeb10
33 changed files with 269 additions and 57 deletions

View File

@ -445,7 +445,6 @@ libc_common_cflags := \
-D_LIBC=1 \
-DSOFTFLOAT \
-DFLOATING_POINT \
-DNEED_PSELECT=1 \
-DINET6 \
-I$(LOCAL_PATH)/private \
-DUSE_DL_PREFIX \

View File

@ -26,14 +26,17 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern char** environ;
int clearenv(void)
{
char **P = environ;
int offset;
char **P = environ;
for (P = &environ[offset]; *P; ++P)
*P = 0;
return 0;
if (P != NULL) {
for (; *P; ++P)
*P = NULL;
}
return 0;
}

View File

@ -29,7 +29,7 @@
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
//#include <sys/types.h>
#include "cpuacct.h"
int cpuacct_add(uid_t uid)
{

View File

@ -27,6 +27,7 @@
*/
#include <unistd.h>
#include "pthread_internal.h"
#include "cpuacct.h"
extern int __fork(void);

View File

@ -548,9 +548,9 @@ fts_build(FTS *sp, int type)
DIR *dirp;
void *oldaddr;
size_t len, maxlen;
int nitems, cderrno, descend, level, nlinks, nostat, doadjust;
int nitems, cderrno, descend, level, nlinks, nostat = 0, doadjust;
int saved_errno;
char *cp;
char *cp = NULL;
/* Set current node pointer. */
cur = sp->fts_cur;

View File

@ -48,6 +48,7 @@
#include <sys/prctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
extern int __pthread_clone(int (*fn)(void*), void *child_stack, int flags, void *arg);
extern void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode);

View File

@ -126,7 +126,7 @@ int __system_property_read(const prop_info *pi, char *name, char *value)
for(;;) {
serial = pi->serial;
while(SERIAL_DIRTY(serial)) {
__futex_wait(&pi->serial, serial, 0);
__futex_wait((volatile void *)&pi->serial, serial, 0);
serial = pi->serial;
}
len = SERIAL_VALUE_LEN(serial);
@ -164,7 +164,7 @@ int __system_property_wait(const prop_info *pi)
} else {
n = pi->serial;
do {
__futex_wait(&pi->serial, n, 0);
__futex_wait((volatile void *)&pi->serial, n, 0);
} while(n == pi->serial);
}
return 0;

View File

@ -46,6 +46,19 @@ Differences between current and Android 2.2:
point. We need better multi-byte support code, and wprintf/wscanf
stuff too.
- <inttypes.h>: add missing declarations for strntoimax abd strntoumax.
- <stdlib.h>: add missing declarations for drand48() and erand48().
- clearerr(): fix broken implementation.
- Feature test macros like _POSIX_C_SOURCE / _XOPEN_SOURCE / _C99_SOURCE
are now handled correctly by our C library headers (see <sys/cdefs.h>)
- <sys/select.h>: add missing declaration for pselect()
-
-------------------------------------------------------------------------------
Differences between Android 2.2. and Android 2.1:

View File

@ -253,6 +253,9 @@ intmax_t imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t strtoimax(const char *, char **, int);
uintmax_t strtoumax(const char *, char **, int);
intmax_t strntoimax(const char *nptr, char **endptr, int base, size_t n);
uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n);
__END_DECLS
#endif /* _INTTYPES_H_ */

View File

@ -86,7 +86,7 @@
#include <sys/limits.h>
#if __POSIX_VISIBLE
#include <arch/syslimits.h>
#include <sys/syslimits.h>
#endif
#ifndef PAGESIZE

View File

@ -305,7 +305,7 @@ char *cuserid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);
#if (__POSIX_VISIBLE >= 199209) || 1 /* ANDROID: Bionic does include this */
#if (__POSIX_VISIBLE >= 199209)
int pclose(FILE *);
FILE *popen(const char *, const char *);
#endif

View File

@ -107,6 +107,8 @@ extern long mrand48(void);
extern long nrand48(unsigned short *);
extern long lrand48(void);
extern unsigned short *seed48(unsigned short*);
extern double erand48(unsigned short xsubi[3]);
extern double drand48(void);
extern void srand48(long);
extern unsigned int arc4random(void);
extern void arc4random_stir(void);

View File

@ -37,12 +37,6 @@
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_
/* our implementation of wchar_t is only 8-bit - die die non-portable code */
#undef __WCHAR_TYPE__
#define __WCHAR_TYPE__ unsigned char
/*
* Macro to test if we're using a GNU C compiler of a specific vintage
* or later, for e.g. features that appeared in a particular version
@ -62,11 +56,6 @@
#define __GNUC_PREREQ__(x, y) 0
#endif
//XXX #include <machine/cdefs.h>
/* BIONIC: simpler definition */
#define __BSD_VISIBLE 1
#include <sys/cdefs_elf.h>
#if defined(__cplusplus)
@ -378,6 +367,134 @@
*/
#define __FBSDID(s) struct __hack
/*-
* The following definitions are an extension of the behavior originally
* implemented in <sys/_posix.h>, but with a different level of granularity.
* POSIX.1 requires that the macros we test be defined before any standard
* header file is included.
*
* Here's a quick run-down of the versions:
* defined(_POSIX_SOURCE) 1003.1-1988
* _POSIX_C_SOURCE == 1 1003.1-1990
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
* _POSIX_C_SOURCE == 199309 1003.1b-1993
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
* _POSIX_C_SOURCE == 200112 1003.1-2001
* _POSIX_C_SOURCE == 200809 1003.1-2008
*
* In addition, the X/Open Portability Guide, which is now the Single UNIX
* Specification, defines a feature-test macro which indicates the version of
* that specification, and which subsumes _POSIX_C_SOURCE.
*
* Our macros begin with two underscores to avoid namespace screwage.
*/
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 700
#define __XSI_VISIBLE 700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809
#elif _XOPEN_SOURCE - 0 >= 600
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#elif _XOPEN_SOURCE - 0 >= 500
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
#endif
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 198808
#endif
#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE >= 200809
#define __POSIX_VISIBLE 200809
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 200112
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 199506
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199309
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199209
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199009
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
#else
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#else /* Default environment: show everything. */
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 1999
#endif
#endif
/*
* Default values.
*/
#ifndef __XPG_VISIBLE
# define __XPG_VISIBLE 700
#endif
#ifndef __POSIX_VISIBLE
# define __POSIX_VISIBLE 200809
#endif
#ifndef __ISO_C_VISIBLE
# define __ISO_C_VISIBLE 1999
#endif
#ifndef __BSD_VISIBLE
# define __BSD_VISIBLE 1
#endif
#define __BIONIC__ 1

View File

@ -31,12 +31,15 @@
#include <sys/cdefs.h>
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
__BEGIN_DECLS
typedef __kernel_fd_set fd_set;
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int pselect(int n, fd_set *readfds, fd_set *writefds, fd_set *errfds,
const struct timespec *timeout, const sigset_t *sigmask);
__END_DECLS

View File

@ -62,8 +62,10 @@ typedef __kernel_ino_t ino_t;
typedef __kernel_key_t key_t;
typedef __kernel_mode_t mode_t;
typedef __kernel_nlink_t nlink_t;
#ifndef _OFF_T_DEFINED_
#define _OFF_T_DEFINED_
typedef __kernel_off_t off_t;
#endif
typedef __kernel_loff_t loff_t;
typedef loff_t off64_t; /* GLibc-specific */

View File

@ -72,7 +72,7 @@ typedef enum {
#define WCHAR_MAX INT_MAX
#define WCHAR_MIN INT_MIN
#define WEOF ((wchar_t)(-1))
#define WEOF ((wint_t)(-1))
extern wint_t btowc(int);
extern int fwprintf(FILE *, const wchar_t *, ...);

View File

@ -33,6 +33,7 @@ __RCSID("$NetBSD: ev_timers.c,v 1.2 2004/05/20 19:52:31 christos Exp $");
/* Import. */
#include <errno.h>
#include <time.h>
#include <isc/assertions.h>
#include <isc/eventlib.h>

View File

@ -47,7 +47,7 @@ static int fmt1(int t, char s, char **buf, size_t *buflen);
/* Macros. */
#define T(x) if ((x) < 0) return (-1); else
#define T(x) do { if ((x) < 0) return (-1); } while(0)
/* Public. */

View File

@ -141,7 +141,7 @@ b64_ntop(src, srclength, target, targsize)
size_t targsize;
{
size_t datalength = 0;
u_char input[3];
u_char input[3] = { 0, 0, 0 }; /* make compiler happy */
u_char output[4];
size_t i;

View File

@ -100,6 +100,12 @@
#include <stdarg.h>
#include "nsswitch.h"
typedef union sockaddr_union {
struct sockaddr generic;
struct sockaddr_in in;
struct sockaddr_in6 in6;
} sockaddr_union;
#define SUCCESS 0
#define ANY 0
#define YES 1
@ -349,13 +355,14 @@ _have_ipv6() {
{{{ 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}},
/* scope ID */
0};
static const struct sockaddr *sa_test = (struct sockaddr *) &sin6_test;
sockaddr_union addr_test;
addr_test.in6 = sin6_test;
int s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (s < 0)
return 0;
int ret;
do {
ret = connect(s, sa_test, sizeof(sin6_test));
ret = connect(s, &addr_test.generic, sizeof(addr_test.in6));
} while (ret < 0 && errno == EINTR);
int have_ipv6 = (ret == 0);
do {
@ -1261,7 +1268,7 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
struct addrinfo_sort_elem {
struct addrinfo *ai;
int has_src_addr;
struct sockaddr_in6 src_addr; /* Large enough to hold IPv4 or IPv6. */
sockaddr_union src_addr;
int original_order;
};
@ -1433,11 +1440,11 @@ _rfc3484_compare(const void *ptr1, const void* ptr2)
}
/* Rule 2: Prefer matching scope. */
scope_src1 = _get_scope((const struct sockaddr *)&a1->src_addr);
scope_src1 = _get_scope(&a1->src_addr.generic);
scope_dst1 = _get_scope(a1->ai->ai_addr);
scope_match1 = (scope_src1 == scope_dst1);
scope_src2 = _get_scope((const struct sockaddr *)&a2->src_addr);
scope_src2 = _get_scope(&a2->src_addr.generic);
scope_dst2 = _get_scope(a2->ai->ai_addr);
scope_match2 = (scope_src2 == scope_dst2);
@ -1456,11 +1463,11 @@ _rfc3484_compare(const void *ptr1, const void* ptr2)
*/
/* Rule 5: Prefer matching label. */
label_src1 = _get_label((const struct sockaddr *)&a1->src_addr);
label_src1 = _get_label(&a1->src_addr.generic);
label_dst1 = _get_label(a1->ai->ai_addr);
label_match1 = (label_src1 == label_dst1);
label_src2 = _get_label((const struct sockaddr *)&a2->src_addr);
label_src2 = _get_label(&a2->src_addr.generic);
label_dst2 = _get_label(a2->ai->ai_addr);
label_match2 = (label_src2 == label_dst2);
@ -1493,9 +1500,9 @@ _rfc3484_compare(const void *ptr1, const void* ptr2)
*/
if (a1->has_src_addr && a1->ai->ai_addr->sa_family == AF_INET6 &&
a2->has_src_addr && a2->ai->ai_addr->sa_family == AF_INET6) {
const struct sockaddr_in6 *a1_src = (const struct sockaddr_in6 *)&a1->src_addr;
const struct sockaddr_in6 *a1_src = &a1->src_addr.in6;
const struct sockaddr_in6 *a1_dst = (const struct sockaddr_in6 *)a1->ai->ai_addr;
const struct sockaddr_in6 *a2_src = (const struct sockaddr_in6 *)&a2->src_addr;
const struct sockaddr_in6 *a2_src = &a2->src_addr.in6;
const struct sockaddr_in6 *a2_dst = (const struct sockaddr_in6 *)a2->ai->ai_addr;
prefixlen1 = _common_prefix_len(&a1_src->sin6_addr, &a1_dst->sin6_addr);
prefixlen2 = _common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr);
@ -1600,7 +1607,7 @@ _rfc3484_sort(struct addrinfo *list_sentinel)
elems[i].ai = cur;
elems[i].original_order = i;
has_src_addr = _find_src_addr(cur->ai_addr, (struct sockaddr *)&elems[i].src_addr);
has_src_addr = _find_src_addr(cur->ai_addr, &elems[i].src_addr.generic);
if (has_src_addr == -1) {
goto error;
}

View File

@ -339,11 +339,14 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags)
assert(addr != NULL);
assert(host != NULL);
if (hostlen < 0)
return EAI_OVERFLOW;
if (inet_ntop(AF_INET6, addr, numaddr, sizeof(numaddr)) == NULL)
return EAI_SYSTEM;
numaddrlen = strlen(numaddr);
if (numaddrlen + 1 > hostlen) /* don't forget terminator */
if (numaddrlen + 1 > (size_t)hostlen) /* don't forget terminator */
return EAI_OVERFLOW;
strlcpy(host, numaddr, hostlen);
@ -356,7 +359,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags)
zonebuf, sizeof(zonebuf), flags);
if (zonelen < 0)
return EAI_OVERFLOW;
if ((size_t) zonelen + 1 + numaddrlen + 1 > hostlen)
if ((size_t) zonelen + 1 + numaddrlen + 1 > (size_t)hostlen)
return EAI_OVERFLOW;
/* construct <numeric-addr><delim><zoneid> */
memcpy(host + numaddrlen + 1, zonebuf,

41
libc/private/cpuacct.h Normal file
View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2010 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _BIONIC_CPUACCT_H
#define _BIONIC_CPUACCT_H
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
extern int cpuacct_add(uid_t uid);
__END_DECLS
#endif /* _BIONIC_CPUACCT_H */

View File

@ -209,7 +209,7 @@ matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
STATETEARDOWN(m);
return(REG_ESPACE);
}
for (i = 1; i <= m->g->nsub; i++)
for (i = 1; i <= (int)m->g->nsub; i++)
m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1;
if (!g->backrefs && !(m->eflags&REG_BACKR)) {
NOTE("dissecting");
@ -267,8 +267,8 @@ matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
}
if (nmatch > 1) {
assert(m->pmatch != NULL);
for (i = 1; i < nmatch; i++)
if (i <= m->g->nsub)
for (i = 1; i < (ssize_t)nmatch; i++)
if (i <= (int)m->g->nsub)
pmatch[i] = m->pmatch[i];
else {
pmatch[i].rm_so = -1;

View File

@ -249,8 +249,8 @@ static void
p_ere(struct parse *p, int stop) /* character this ERE should end at */
{
char c;
sopno prevback;
sopno prevfwd;
sopno prevback = 0;
sopno prevfwd = 0;
sopno conc;
int first = 1; /* is this the first alternative? */
@ -767,7 +767,7 @@ static void
p_b_cclass(struct parse *p, cset *cs)
{
char *sp = p->next;
struct cclass *cp;
const struct cclass *cp;
size_t len;
char *u;
char c;
@ -831,7 +831,7 @@ p_b_coll_elem(struct parse *p,
int endc) /* name ended by endc,']' */
{
char *sp = p->next;
struct cname *cp;
const struct cname *cp;
int len;
while (MORE() && !SEETWO(endc, ']'))
@ -1084,7 +1084,7 @@ freeset(struct parse *p, cset *cs)
cset *top = &p->g->sets[p->g->ncsets];
size_t css = (size_t)p->g->csetsize;
for (i = 0; i < css; i++)
for (i = 0; i < (ssize_t)css; i++)
CHsub(cs, i);
if (cs == top-1) /* recover only the easy case */
p->g->ncsets--;
@ -1112,10 +1112,10 @@ freezeset(struct parse *p, cset *cs)
for (cs2 = &p->g->sets[0]; cs2 < top; cs2++)
if (cs2->hash == h && cs2 != cs) {
/* maybe */
for (i = 0; i < css; i++)
for (i = 0; i < (ssize_t)css; i++)
if (!!CHIN(cs2, i) != !!CHIN(cs, i))
break; /* no */
if (i == css)
if (i == (ssize_t)css)
break; /* yes */
}
@ -1136,7 +1136,7 @@ firstch(struct parse *p, cset *cs)
int i;
size_t css = (size_t)p->g->csetsize;
for (i = 0; i < css; i++)
for (i = 0; i < (ssize_t)css; i++)
if (CHIN(cs, i))
return((char)i);
assert(never);
@ -1153,7 +1153,7 @@ nch(struct parse *p, cset *cs)
size_t css = (size_t)p->g->csetsize;
int n = 0;
for (i = 0; i < css; i++)
for (i = 0; i < (ssize_t)css; i++)
if (CHIN(cs, i))
n++;
return(n);
@ -1412,7 +1412,7 @@ static void
findmust(struct parse *p, struct re_guts *g)
{
sop *scan;
sop *start; /* start initialized in the default case, after that */
sop *start = NULL; /* start initialized in the default case, after that */
sop *newstart; /* newstart was initialized in the OCHAR case */
sopno newlen;
sop s;

View File

@ -78,7 +78,7 @@ static const struct rerr {
size_t
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{
struct rerr *r;
const struct rerr *r;
size_t len;
int target = errcode &~ REG_ITOA;
char *s;
@ -117,7 +117,7 @@ regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
static char *
regatoi(const regex_t *preg, char *localbuf, int localbufsize)
{
struct rerr *r;
const struct rerr *r;
for (r = rerrs; r->code != 0; r++)
if (strcmp(r->name, preg->re_endp) == 0)

View File

@ -153,7 +153,7 @@ regexec(const regex_t *preg, const char *string, size_t nmatch,
return(REG_BADPAT);
eflags = GOODFLAGS(eflags);
if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags&REG_LARGE))
if (g->nstates <= (int)(CHAR_BIT*sizeof(states1)) && !(eflags&REG_LARGE))
return(smatcher(g, (char *)string, nmatch, pmatch, eflags));
else
return(lmatcher(g, (char *)string, nmatch, pmatch, eflags));

View File

@ -48,7 +48,7 @@ static inline int digitval(int ch)
uintmax_t
strntoumax(const char *nptr, char **endptr, int base, size_t n)
{
const unsigned char* p = nptr;
const unsigned char* p = (const unsigned char *)nptr;
const unsigned char* end = p + n;
int minus = 0;
uintmax_t v = 0;

View File

@ -389,7 +389,11 @@ const time_t t0;
if (TYPE_INTEGRAL(time_t) &&
TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
return 0;
#if SECSPERREPEAT_BITS <= 32 /* to avoid compiler warning (condition is always false) */
return (t1 - t0) == SECSPERREPEAT;
#else
return 0;
#endif
}
static int toint(unsigned char *s) {

View File

@ -26,6 +26,9 @@
* SUCH DAMAGE.
*/
#include <unistd.h>
#include "cpuacct.h"
extern int __setresuid(uid_t, uid_t, uid_t);
int seteuid(uid_t euid)
{

View File

@ -26,6 +26,9 @@
* SUCH DAMAGE.
*/
#include <unistd.h>
#include "cpuacct.h"
extern int __setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresuid(uid_t ruid, uid_t euid, uid_t suid)
{

View File

@ -26,6 +26,9 @@
* SUCH DAMAGE.
*/
#include <unistd.h>
#include "cpuacct.h"
extern int __setreuid(uid_t ruid, uid_t euid);
int setreuid(uid_t ruid, uid_t euid)
{

View File

@ -26,6 +26,9 @@
* SUCH DAMAGE.
*/
#include <unistd.h>
#include "cpuacct.h"
extern int __setuid(uid_t);
int setuid(uid_t uid)
{

View File

@ -96,7 +96,7 @@ sysconf( int name )
case _SC_COLL_WEIGHTS_MAX: return _POSIX2_COLL_WEIGHTS_MASK;
#endif
#ifdef _POSIX2_EXPR_NEST_MAX
case _SC_EXPR_NEXT_MASK: return _POSIX2_EXPR_NEST_MAX;
case _SC_EXPR_NEST_MAX: return _POSIX2_EXPR_NEST_MAX;
#endif
#ifdef _POSIX2_LINE_MAX
case _SC_LINE_MAX: return _POSIX2_LINE_MAX;