summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-01-08 16:33:15 +0000
committerpfg <pfg@FreeBSD.org>2015-01-08 16:33:15 +0000
commitb13045e2b61552f46a5bd3fb895d2adbcba158da (patch)
treec191485719a7491d96cd21edad9beca5abbff3c5
parente33331bd0746d18d49ba480e4e75e75e423a4fec (diff)
downloadFreeBSD-src-b13045e2b61552f46a5bd3fb895d2adbcba158da.zip
FreeBSD-src-b13045e2b61552f46a5bd3fb895d2adbcba158da.tar.gz
sed: Address warnings with clang and gcc48.
MFC after: 2 weeks
-rw-r--r--usr.bin/sed/Makefile2
-rw-r--r--usr.bin/sed/main.c6
-rw-r--r--usr.bin/sed/process.c4
3 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/sed/Makefile b/usr.bin/sed/Makefile
index a741da3..60dc271 100644
--- a/usr.bin/sed/Makefile
+++ b/usr.bin/sed/Makefile
@@ -6,8 +6,6 @@
PROG= sed
SRCS= compile.c main.c misc.c process.c
-WARNS?= 2
-
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 76e186f..029a79f 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -400,13 +400,13 @@ mf_fgets(SPACE *sp, enum e_spflag spflag)
sizeof(oldfname));
len = strlcat(oldfname, inplace,
sizeof(oldfname));
- if (len > sizeof(oldfname))
+ if (len > (ssize_t)sizeof(oldfname))
errx(1, "%s: name too long", fname);
}
len = snprintf(tmpfname, sizeof(tmpfname),
"%s/.!%ld!%s", dirname(fname), (long)getpid(),
basename(fname));
- if (len >= sizeof(tmpfname))
+ if (len >= (ssize_t)sizeof(tmpfname))
errx(1, "%s: name too long", fname);
unlink(tmpfname);
if ((outfile = fopen(tmpfname, "w")) == NULL)
@@ -488,7 +488,7 @@ add_file(char *s)
}
static int
-next_files_have_lines()
+next_files_have_lines(void)
{
struct s_flist *file;
FILE *file_fd;
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 9cd2c2e..71fb519 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -71,7 +71,7 @@ static __inline int applies(struct s_command *);
static void do_tr(struct s_tr *);
static void flush_appends(void);
static void lputs(char *, size_t);
-static __inline int regexec_e(regex_t *, const char *, int, int, size_t);
+static int regexec_e(regex_t *, const char *, int, int, size_t);
static void regsub(SPACE *, char *, char *);
static int substitute(struct s_command *);
@@ -656,7 +656,7 @@ lputs(char *s, size_t len)
errx(1, "%s: %s", outfname, strerror(errno ? errno : EIO));
}
-static __inline int
+static int
regexec_e(regex_t *preg, const char *string, int eflags, int nomatch,
size_t slen)
{
OpenPOWER on IntegriCloud