sed: Address warnings with clang and gcc48.

MFC after:	2 weeks
This commit is contained in:
Pedro F. Giffuni 2015-01-08 16:33:15 +00:00
parent 9fb7b3949c
commit 707c9cc5d1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276832
3 changed files with 5 additions and 7 deletions

View File

@ -6,8 +6,6 @@
PROG= sed
SRCS= compile.c main.c misc.c process.c
WARNS?= 2
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif

View File

@ -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;

View File

@ -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)
{