[Bug 210834] devel/gmake-lite: make-4.2.1/strcache.c's strcache_print_stats(. . .) uses %hu for an int value

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jul 5 05:24:17 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210834

            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 at FreeBSD.org
          Reporter: markmi at dsl-only.net
             Flags: maintainer-feedback?(bapt at FreeBSD.org)
          Assignee: bapt at FreeBSD.org

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

  printf (_("%s current buf: size = %hu B / used = %hu B / count = %hu / avg =
%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 short
type that the matching %hu format specifies.

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

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

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


More information about the freebsd-ports-bugs mailing list