Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jul 2016 05:24:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 210834] devel/gmake-lite: make-4.2.1/strcache.c's strcache_print_stats(. . .) uses %hu for an int value
Message-ID:  <bug-210834-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210834

            Bug ID: 210834
           Summary: devel/gmake-lite: make-4.2.1/strcache.c's
                    strcache_print_stats(. . .) uses %hu for an int value
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: bapt@FreeBSD.org
          Reporter: markmi@dsl-only.net
             Flags: maintainer-feedback?(bapt@FreeBSD.org)
          Assignee: bapt@FreeBSD.org

devel/gmake-lite/work/make-4.2.1/strcache.c has code in strcache_print_stat=
s(.
. .) that looks like:

  printf (_("%s current buf: size =3D %hu B / used =3D %hu B / count =3D %h=
u / avg =3D
%hu B\n"),
          prefix, (sc_buflen_t)BUFSIZE, strcache->end, strcache->count,
          (strcache->end / strcache->count));

but (strcache->end / strcache->count) has an int type, not the unsigned sho=
rt
type that the matching %hu format specifies.

This can make the code big-endian vs. little-endian (vs. pdp-endian) specif=
ic
and wrong about the output value.

This was reported by the compiler it was built with when targeting armv6 (w=
ith
-mcpu=3Dcortex-a7 in use for an rpi2).

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-210834-13>