Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jun 2013 19:32:08 +0200
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   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]
Message-ID:  <20130609193208.75c8810d@thor.walstatt.dyndns.org>

next in thread | raw e-mail | index | archive | help
--Sig_/1U7.iq8SpxlmWGqwAuohvnv
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable


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=3Dnative -fno-strict-aliasing -O3 -march=3Dnative
-DNV_VERSION_STRING=3D\"319.23\" -D__KERNEL__ -DNVRM -Wno-unused-function
-Wuninitialized -O -mno-red-zone -mcmodel=3Dkernel -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=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
-std=3Diso9899: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=20

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

    if (nvidia_pci_find_capability(sc->dev, PCIR_CAP_ID_EXP) !=3D 0)
        bus_type =3D "PCIe";
    else
        bus_type =3D "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 =3D arg1;
    char *bus_type;

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

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

Somehow, the complete return SYSCTL_OUT() gets deleted.

Oliver

--Sig_/1U7.iq8SpxlmWGqwAuohvnv
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQEcBAEBAgAGBQJRtLwcAAoJEOgBcD7A/5N8QeIIAIw6BIxItXgndetoEFoFTpFF
57S6H8stJrndHRxAZGwa1TkoVYZPDa6+6hrNMZZndIR0Gh0D2hkG/HBItV8h4Xm3
VuGLLSBxNDg5EE1jZ1gppxzIBy6NsmvawoLr7dSpjZFvvPNrcy+7YrId42gVPDQr
e+CVJseiBBz0KdRAAULB3UUieYHocz0w+TxLmMTAu3t9xs9ptTpkELL2dJNfWfnQ
FBBBPOZs6yoLOcyiFZTdzYPpmCWq1gDjThpUSYeaBHAUgFCxWROUSpbuRa3w2JJO
/nTtowIKTTwBZ3VSjyiMP9Afv/QsiSTlWp6WqTep0qTAECZZF/BIz2ND0rpc/Ok=
=AqQq
-----END PGP SIGNATURE-----

--Sig_/1U7.iq8SpxlmWGqwAuohvnv--



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