if (base > pe->lowsec) {
fprintf(stderr,
"%s: fixed partition %u is preceded by too big partitions/holes\n",
- arg0, ((pe - table) - 1) / 2);
+ arg0, ((unsigned int)(pe - table) - 1) / 2);
exit(1);
}
exp= nil; /* XXX - Extend before? */
static void test_getnameinfo_all(void)
{
int flag_NUMERICHOST, flag_NAMEREQD, flag_NUMERICSERV, flag_DGRAM;
- int exp_results, flagcount, flags, i, j, k, l, socktypemismatch;
+ int exp_results, flagcount, flags, i, j, k, l;
const char *nodename, *servname;
/* set ports servent structs */
if (buflens[k] > 0 && buflens[k] <= strlen(nodename))
exp_results |= (1 << EAI_OVERFLOW) | (1 << EAI_MEMORY);
- socktypemismatch =
- (flag_DGRAM && ports[j].socktype == SOCK_STREAM) ||
- (!flag_DGRAM && ports[j].socktype == SOCK_DGRAM);
-
struct servent *se = flag_DGRAM ? ports[j].se_udp : ports[j].se_tcp;
servname = (flag_NUMERICSERV) ?
}
}
+static void do_not_optimize_away(volatile u64_t * ptr)
+{
+
+ /* TODO: does this actually do the job? */
+ *ptr ^= 1;
+}
+
static void testdiv0(void)
{
int funcidx;
default: assert(0); ERR; break;
}
+ do_not_optimize_away((volatile u64_t *)&res);
+
/* if we reach this point there was no signal and an
* error has been recorded
*/
#if !defined(__minix)
int yes = 1;
#endif
- int fd_sock, fd_new, r;
+ int fd_sock, fd_new;
struct sockaddr_in my_addr;
struct sockaddr_in other_addr;
socklen_t other_size;
e(5);
}
- r = read(fd_new, buf, sizeof(buf));
+ (void)read(fd_new, buf, sizeof(buf));
exit(0);
}
static void do_symlink1(void *buf, int fd, int writable)
{
- int r;
/* the system call just has to fail gracefully */
- r = symlink(buf, NODENAME);
+ (void)symlink(buf, NODENAME);
}
static void do_symlink2(void *buf, int fd, int writable)
{
- int r;
/* the system call just has to fail gracefully */
- r = symlink(NODENAME, buf);
+ (void)symlink(NODENAME, buf);
}
static void do_open(void *buf, int fd, int writable)
static void do_select1(void *buf, int fd, int writable)
{
- int r;
struct timeval timeout = { 0, 200000 }; /* 0.2 sec */
/* the system call just has to fail gracefully */
- r = select(1, buf, NULL, NULL, &timeout);
+ (void)select(1, buf, NULL, NULL, &timeout);
}
static void do_select2(void *buf, int fd, int writable)
{
- int r;
struct timeval timeout = { 0, 200000 }; /* 1 sec */
/* the system call just has to fail gracefully */
- r = select(1, NULL, buf, NULL, &timeout);
+ (void)select(1, NULL, buf, NULL, &timeout);
}
static void do_select3(void *buf, int fd, int writable)
{
- int r;
struct timeval timeout = { 0, 200000 }; /* 1 sec */
/* the system call just has to fail gracefully */
- r = select(1, NULL, NULL, buf, &timeout);
+ (void)select(1, NULL, NULL, buf, &timeout);
}
static void fillfile(int fd, int size)
pid_t pid;
u_quad_t q;
bool b, b2;
- int i, va[2], lastva, mib[CTL_MAXNAME + 1];
+ int i, va[2], lastva = -1 /*gcc*/, mib[CTL_MAXNAME + 1];
subtest = 0;
if (errno != EINVAL) e(0);
memcpy(&scn, &tmpscn, sizeof(scn));
- scn.sysctl_size = SSIZE_MAX + 1;
+ scn.sysctl_size = (size_t)SSIZE_MAX + 1;
if (sysctl(mib, 3, NULL, NULL, &scn, sizeof(scn)) != -1) e(0);
if (errno != EINVAL) e(0);
if (errno != EINVAL) e(0);
memcpy(&scn, &tmpscn, sizeof(scn));
- scn.sysctl_size = SSIZE_MAX + 1;
+ scn.sysctl_size = (size_t)SSIZE_MAX + 1;
if (sysctl(mib, 3, NULL, NULL, &scn, sizeof(scn)) != -1) e(0);
if (errno != EINVAL) e(0);
* contents match expectations, or -1 if they do not.
*/
static int
-test_buf(unsigned char * buf, unsigned char c, size_t size, int set)
+test_buf(char * buf, unsigned char c, size_t size, int set)
{
+ unsigned char *ptr;
int step;
+ ptr = (unsigned char *)buf;
+
for (step = 1; size > 0; size--) {
if (set)
- *buf++ = c;
- else if (*buf++ != c)
+ *ptr++ = c;
+ else if (*ptr++ != c)
return -1;
c += step;
* Drop user and group privileges in the child process if requested.
*/
static void
-spawn(struct link * link, void (* proc)(), int drop)
+spawn(struct link * link, void (* proc)(struct link *), int drop)
{
struct passwd *pw;
struct group *gr;
*/
memset(val, 0, sizeof(val));
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 3; i++) {
switch (i) {
case 0:
cmd = GETALL;
ptr = &semds;
bit = 4;
break;
+ default:
+ abort();
}
r = semctl(id[0], 0, cmd, ptr);
sub89b(setnum);
return;
+
+ default:
+ abort();
}
if (res != 0 && (res != -1 || errno != EPERM)) e(setnum);
sub89d(setnum);
return;
+
+ default:
+ abort();
}
if (res != 0 && (res != -1 || errno != EPERM)) e(setnum);