[Bug 211317] benchmarks/iozone -r418971 for armv6 and other ILP32 FreeBSD architectures: %ld format will not work right for long long types

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jul 23 20:54:51 UTC 2016


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

            Bug ID: 211317
           Summary: benchmarks/iozone -r418971 for armv6 and other ILP32
                    FreeBSD architectures: %ld format will not work right
                    for long long types
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: jpaetzel at FreeBSD.org
          Reporter: markmi at dsl-only.net
          Assignee: jpaetzel at FreeBSD.org
             Flags: maintainer-feedback?(jpaetzel at FreeBSD.org)

The following messages mean that the formats will not work correctly for ILP32
architectures, such as powerpc and armv6.

powerpc will access/update the most significant 32 bits of the long long's
involved: it is big endian. powerpc will have more problems with this code then
armv6 or i896.

armv6 will access/update the least significant 32 bits of the long long's
involved: it is little endian. (i386 would match this.)

The scanf's need the format and storage to match layouts, including size.
Casting the type of the argument will not fix the issue of using %ld.

The printf's could have truncation problems if casts to long are used. Using
%lld and casts to long long would avoid this issue.


I only list the first few compiler messages below. There are a lot more.

iozone.c:1921:24: warning: format specifies type 'long *' but the argument has
type 'off64_t *' (aka 'long long *') [-Wformat]
                        sscanf(optarg,"%ld",&kilobytes64);
                                       ~~~  ^~~~~~~~~~~~
                                       %lld
iozone.c:1945:68: warning: format specifies type 'long' but the argument has
type 'off64_t' (aka 'long long') [-Wformat]
                        sprintf(splash[splash_line++],"\tFile size set to %ld
kB\n",kilobytes64);
                                                                          ~~~  
    ^~~~~~~~~~~
                                                                          %lld
iozone.c:2319:82: warning: format specifies type 'long' but the argument has
type 'off64_t' (aka 'long long') [-Wformat]
                        sprintf(splash[splash_line++],"\tUsing minimum file
size of %ld kilobytes.\n",minimum_file_size);
                                                                               
    ~~~               ^~~~~~~~~~~~~~~~~
                                                                               
    %lld
iozone.c:2342:82: warning: format specifies type 'long' but the argument has
type 'off64_t' (aka 'long long') [-Wformat]
                        sprintf(splash[splash_line++],"\tUsing maximum file
size of %ld kilobytes.\n",maximum_file_size);
                                                                               
    ~~~               ^~~~~~~~~~~~~~~~~
                                                                               
    %lld

. . .

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


More information about the freebsd-ports-bugs mailing list