x11/nvidia-driver: NVIDIA-FreeBSD-x86_64-319.23: nvidia_sysctl.c:174:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]

O. Hartmann ohartman at zedat.fu-berlin.de
Sun Jun 9 17:32:21 UTC 2013


I try to install the most recent nvidia-GPU driver for FreeBSD, which
is 319.23.

I face a strange bug, which reports while compiling:



[...]
cc -O2 -pipe -O3 -march=native -fno-strict-aliasing -O3 -march=native
-DNV_VERSION_STRING=\"319.23\" -D__KERNEL__ -DNVRM -Wno-unused-function
-Wuninitialized -O -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG
-DNDEBUG -O3 -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I. -I@
-I@/contrib/altq -fno-common  -fno-omit-frame-pointer  -mno-aes
-mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
-std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option  -Wno-error-tautological-compare
-Wno-error-empty-body  -Wno-error-parentheses-equality  -c
nvidia_sysctl.c nvidia_sysctl.c:174:1: error: control reaches end of
non-void function [-Werror,-Wreturn-type] } ^ 1 error generated. ***
Error code 1

Stop.
make: stopped
in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-319.23/src
[...]

Interestingly, the line 174 of file nvidia_sysctl.c is a function
called 

int nvidia_sysctl_bus_type(SYSCTL_HANDLER_ARGS)
{
    struct nvidia_softc *sc = arg1;
    char *bus_type;

    if (nvidia_pci_find_capability(sc->dev, PCIR_CAP_ID_EXP) != 0)
        bus_type = "PCIe";
    else
        bus_type = "PCI";

}


which is supposed to be patched by the Makefile of the port - but for
some reasons, there is the "return 0;" gone as well as the patched
line, which can be found in nvidia_sysctl.c.bak and states:

int nvidia_sysctl_bus_type(SYSCTL_HANDLER_ARGS)
{
    struct nvidia_softc *sc = arg1;
    char *bus_type;

    if (nvidia_pci_find_capability(sc->dev, PCIR_CAP_ID_EXP) != 0)
        bus_type = "PCIe";
    else
        bus_type = "PCI";

    return SYSCTL_OUT(req, bus_type, strlen(bus_type) + 1);
}

Somehow, the complete return SYSCTL_OUT() gets deleted.

Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130609/73ab767c/attachment.sig>


More information about the freebsd-ports mailing list