gcc4 does not care about &foo; use volatile instead. From Anon Ymous

This commit is contained in:
christos 2006-12-13 18:04:08 +00:00
parent 3e978579d3
commit 748af04e26
3 changed files with 46 additions and 74 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fetch.c,v 1.172 2006/11/25 16:48:32 christos Exp $ */
/* $NetBSD: fetch.c,v 1.173 2006/12/13 18:04:08 christos Exp $ */
/*-
* Copyright (c) 1997-2006 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fetch.c,v 1.172 2006/11/25 16:48:32 christos Exp $");
__RCSID("$NetBSD: fetch.c,v 1.173 2006/12/13 18:04:08 christos Exp $");
#endif /* not lint */
/*
@ -467,21 +467,31 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
struct addrinfo hints, *res, *res0 = NULL;
int error;
char hbuf[NI_MAXHOST];
volatile sigfunc oldintr, oldintp;
volatile int s;
sigfunc volatile oldintr;
sigfunc volatile oldintp;
int volatile s;
struct stat sb;
int ischunked, isproxy, rval, hcode;
int volatile ischunked;
int volatile isproxy;
int volatile rval;
int volatile hcode;
size_t len;
static size_t bufsize;
static char *xferbuf;
const char *cp, *token;
char *ep, *buf, *savefile;
char *auth, *location, *message;
char *user, *pass, *host, *port, *path, *decodedpath;
char *ep;
char *volatile buf;
char *volatile savefile;
char *volatile auth;
char *volatile location;
char *volatile message;
char *user, *pass, *host, *port, *path;
char *volatile decodedpath;
char *puser, *ppass, *useragent;
off_t hashbytes, rangestart, rangeend, entitylen;
int (*closefunc)(FILE *);
FILE *fin, *fout;
int (*volatile closefunc)(FILE *);
FILE *volatile fin;
FILE *volatile fout;
time_t mtime;
url_t urltype;
in_port_t portnum;
@ -496,22 +506,6 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
rval = 1;
user = pass = host = path = decodedpath = puser = ppass = NULL;
#ifdef __GNUC__ /* shut up gcc warnings */
(void)&closefunc;
(void)&fin;
(void)&fout;
(void)&buf;
(void)&savefile;
(void)&rval;
(void)&isproxy;
(void)&hcode;
(void)&ischunked;
(void)&message;
(void)&location;
(void)&auth;
(void)&decodedpath;
#endif
if (parse_url(url, "URL", &urltype, &user, &pass, &host, &port,
&portnum, &path) == -1)
goto cleanup_fetch_url;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ftp.c,v 1.142 2006/10/23 19:53:24 christos Exp $ */
/* $NetBSD: ftp.c,v 1.143 2006/12/13 18:04:08 christos Exp $ */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@ -99,7 +99,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
__RCSID("$NetBSD: ftp.c,v 1.142 2006/10/23 19:53:24 christos Exp $");
__RCSID("$NetBSD: ftp.c,v 1.143 2006/12/13 18:04:08 christos Exp $");
#endif
#endif /* not lint */
@ -600,25 +600,18 @@ sendrequest(const char *cmd, const char *local, const char *remote,
{
struct stat st;
int c, d;
FILE *fin, *dout;
int (*closefunc)(FILE *);
sigfunc oldintr, oldintp;
volatile off_t hashbytes;
char *lmode, *bufp;
FILE *volatile fin;
FILE *volatile dout;
int (*volatile closefunc)(FILE *);
sigfunc volatile oldintr;
sigfunc volatile oldintp;
off_t volatile hashbytes;
char *volatile lmode;
char *bufp;
static size_t bufsize;
static char *buf;
int oprogress;
#ifdef __GNUC__ /* to shut up gcc warnings */
(void)&fin;
(void)&dout;
(void)&closefunc;
(void)&oldintr;
(void)&oldintp;
(void)&lmode;
fin = NULL; /* XXX gcc4 */
#endif
hashbytes = mark;
direction = "sent";
dout = NULL;
@ -895,32 +888,27 @@ sendrequest(const char *cmd, const char *local, const char *remote,
}
void
recvrequest(const char *cmd, const char *local, const char *remote,
recvrequest(const char *cmd, const char *volatile local, const char *remote,
const char *lmode, int printnames, int ignorespecial)
{
FILE *fout, *din;
int (*closefunc)(FILE *);
sigfunc oldintr, oldintp;
FILE *volatile fout;
FILE *volatile din;
int (*volatile closefunc)(FILE *);
sigfunc volatile oldintr;
sigfunc volatile oldintp;
int c, d;
volatile int is_retr, tcrflag, bare_lfs;
int volatile is_retr;
int volatile tcrflag;
int volatile bare_lfs;
static size_t bufsize;
static char *buf;
volatile off_t hashbytes;
off_t volatile hashbytes;
struct stat st;
time_t mtime;
struct timeval tval[2];
int oprogress;
int opreserve;
#ifdef __GNUC__ /* to shut up gcc warnings */
(void)&local;
(void)&fout;
(void)&din;
(void)&closefunc;
(void)&oldintr;
(void)&oldintp;
#endif
fout = NULL;
din = NULL;
hashbytes = mark;
@ -1872,15 +1860,10 @@ abortpt(int notused)
void
proxtrans(const char *cmd, const char *local, const char *remote)
{
sigfunc oldintr;
sigfunc volatile oldintr;
int prox_type, nfnd;
volatile int secndflag;
char *cmd2;
#ifdef __GNUC__ /* to shut up gcc warnings */
(void)&oldintr;
(void)&cmd2;
#endif
int volatile secndflag;
char *volatile cmd2;
oldintr = NULL;
secndflag = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.101 2006/01/31 20:05:36 christos Exp $ */
/* $NetBSD: main.c,v 1.102 2006/12/13 18:04:08 christos Exp $ */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@ -104,7 +104,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.101 2006/01/31 20:05:36 christos Exp $");
__RCSID("$NetBSD: main.c,v 1.102 2006/12/13 18:04:08 christos Exp $");
#endif
#endif /* not lint */
@ -138,7 +138,7 @@ static void setupoption(char *, char *, char *);
int main(int, char *[]);
int
main(int argc, char *argv[])
main(int volatile argc, char **volatile argv)
{
int ch, rval;
struct passwd *pw;
@ -503,11 +503,6 @@ main(int argc, char *argv[])
(void)xsignal(SIGUSR2, crankrate);
(void)xsignal(SIGWINCH, setttywidth);
#ifdef __GNUC__ /* to shut up gcc warnings */
(void)&argc;
(void)&argv;
#endif
if (argc > 0) {
if (isupload) {
rval = auto_put(argc, argv, upload_path);