svn commit: r322609 - in stable/11: contrib/netbsd-tests/usr.bin/grep usr.bin/grep

Kyle Evans kevans at freebsd.org
Thu Aug 17 12:23:35 UTC 2017


Hi,

-HEAD defaults to WITHOUT_GNU_GREP_COMPAT at the moment, so this got missed
and I apparently had this addressed in my local build testing due to other
bits.

@emaste: can I commit the fix for this to -HEAD for MFC immediately?
(unsigned int) cast on pmatch.rm_so.

Thanks,

Kyle Evans

On Aug 17, 2017 5:16 AM, "Christian Ullrich" <chris at chrullrich.net> wrote:

* Kyle Evans wrote:

Author: kevans
> Date: Thu Aug 17 04:26:04 2017
> New Revision: 322609
> URL: https://svnweb.freebsd.org/changeset/base/322609
>
> Log:
>    MFC r318571: bsdgrep: emit more than MAX_LINE_MATCHES per line
>

Modified: stable/11/usr.bin/grep/util.c
> ============================================================
> ==================
> --- stable/11/usr.bin/grep/util.c       Thu Aug 17 04:18:31 2017
> (r322608)
> +++ stable/11/usr.bin/grep/util.c       Thu Aug 17 04:26:04 2017
> (r322609)
>

@@ -356,11 +366,11 @@ procline(struct parsec *pc)
>   {
>         regmatch_t pmatch, lastmatch, chkmatch;
>         wchar_t wbegin, wend;
> -       size_t st = 0, nst = 0;
> +       size_t st, nst;
>         unsigned int i;
>         int c = 0, r = 0, lastmatches = 0, leflags = eflags;
>         size_t startm = 0, matchidx;
> -       int retry;
> +       unsigned int retry;
>

/usr/src/usr.bin/grep/util.c:453:26: error: comparison of integers of
different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
                                    pmatch.rm_so + 1 < retry))
                                    ~~~~~~~~~~~~~~~~ ^ ~~~~~

Why would that fail after MFC? Doesn't head use -Werror too?

# uname -a
FreeBSD infra-poudriere 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE #0
r[unhelpful]: Thu Jul 13 15:30:11 CEST 2017
toor at infra11build:/usr/obj/usr/src/sys/LOCAL
amd64

]# cc --version
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM
4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin

-- 
Christian


More information about the svn-src-stable mailing list