[Bug 206665] ports-mgmt/pkg : 1.6.3 building for RPI2 (arm) gets: passing 'size_t *' (aka 'unsigned int *') to type 'off_t *' (aka 'long long *')

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jan 27 08:34:47 UTC 2016


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

            Bug ID: 206665
           Summary: ports-mgmt/pkg : 1.6.3 building for RPI2 (arm) gets:
                    passing 'size_t *' (aka 'unsigned int *') to type
                    'off_t *' (aka 'long long *')
           Product: Ports & Packages
           Version: Latest
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pkg at FreeBSD.org
          Reporter: markmi at dsl-only.net
             Flags: maintainer-feedback?(pkg at FreeBSD.org)
          Assignee: pkg at FreeBSD.org

On the RPI2B (arm) build for my context there are incompatible pointer types in
use when I try to build the 1.6.3 port: size_t and off_t are different types:
unsigned int vs. long long. So the file_to_buffer use is odd:

pkg_add.c:121:39: warning: incompatible pointer types passing 'size_t *' (aka
'unsigned int *') to parameter of type 'off_t *' (aka 'long long *')
[-Wincompatible-pointer-types]
        file_to_buffer(pathname, &localconf, &sz);
                                             ^~~
./private/utils.h:77:50: note: passing argument to parameter here
int file_to_buffer(const char *, char **, off_t *);

pkg_ports.c:382:39: warning: incompatible pointer types passing 'size_t *' (aka
'unsigned int *') to parameter of type 'off_t *' (aka 'long long *')
[-Wincompatible-pointer-types]
                        file_to_buffer(testpath, &content, &sz);
                                                           ^~~
./private/utils.h:77:50: note: passing argument to parameter here
int file_to_buffer(const char *, char **, off_t *);


Of note is that I'm working on a RPI2B and everything from
buildworld/buildkernel to ports in my build activities are targeting the
armv7-a/cortex-a7 that an RPI2B has, not a more generic armv6. Also I'm using
projects/clang380-import because clang++ 3.7.1 Bus Errors during most C++
compiles in this RPI2B context. 3.8.0 has a bunch of alignment fixes in it to
allow use with SCTLR Bit[1]==1 on arm (and on sparc's that require alignment).



As for the details of my targeting armv7-a and cortex-a7, I show some of the
checking output that shows the command's arguments for such:

checking for /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access option to accept ISO
C99... none needed
. . .
checking if /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access supports -fno-rtti
-fno-exceptions... yes
checking for /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access option to produce
PIC... -fPIC -DPIC
checking if /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access PIC flag -fPIC -DPIC
works... yes
checking if /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access static flag -static
works... yes
checking if /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access supports -c -o
file.o... yes
checking if /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access supports -c -o
file.o... (cached) yes


Side note. . .

There are some other warnings as well, tied to shifting negative, signed
quantities. I show a few below.

utils.c:281:12: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
        if (opt & INFO_RAW) {
                  ^~~~~~~~
./pkgcli.h:243:24: note: expanded from macro 'INFO_RAW'
#define INFO_RAW                (-1LL<<63)
                                 ~~~~^
. . .
utils.c:322:22: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
                switch (options &
(INFO_RAW_YAML|INFO_RAW_JSON|INFO_RAW_JSON_COMPACT|INFO_RAW_UCL)) {
                                   ^~~~~~~~~~~~~
./pkgcli.h:244:29: note: expanded from macro 'INFO_RAW_YAML'
#define INFO_RAW_YAML           (-1LL<<62)
                                 ~~~~^
utils.c:322:36: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
                switch (options &
(INFO_RAW_YAML|INFO_RAW_JSON|INFO_RAW_JSON_COMPACT|INFO_RAW_UCL)) {
                                                 ^~~~~~~~~~~~~
./pkgcli.h:245:29: note: expanded from macro 'INFO_RAW_JSON'
#define INFO_RAW_JSON           (-1LL<<61)
                                 ~~~~^
utils.c:322:50: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
                switch (options &
(INFO_RAW_YAML|INFO_RAW_JSON|INFO_RAW_JSON_COMPACT|INFO_RAW_UCL)) {
                                                              
^~~~~~~~~~~~~~~~~~~~~
./pkgcli.h:246:36: note: expanded from macro 'INFO_RAW_JSON_COMPACT'
#define INFO_RAW_JSON_COMPACT   (-1LL<<60)
                                 ~~~~^
utils.c:322:72: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
                switch (options &
(INFO_RAW_YAML|INFO_RAW_JSON|INFO_RAW_JSON_COMPACT|INFO_RAW_UCL)) {
                                                                               
     ^~~~~~~~~~~~
./pkgcli.h:247:28: note: expanded from macro 'INFO_RAW_UCL'
#define INFO_RAW_UCL            (-1LL<<59)
                                 ~~~~^

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


More information about the freebsd-ports-bugs mailing list