Date: Tue, 27 Aug 2013 14:15:00 GMT From: Nathanael Hoyle <nhoyle@hoyletech.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/181584: x11/nvidia-driver NVIDIA-FreeBSD-x86_64-319.32 fails to build due to uninitialized data warning and -Werror flag Message-ID: <201308271415.r7REF0s5063300@oldred.freebsd.org> Resent-Message-ID: <201308271420.r7REK0a1000300@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 181584 >Category: ports >Synopsis: x11/nvidia-driver NVIDIA-FreeBSD-x86_64-319.32 fails to build due to uninitialized data warning and -Werror flag >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 27 14:20:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Nathanael Hoyle >Release: 9.1-RELEASE >Organization: >Environment: FreeBSD tsuba 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Build fails with: nvidia_acpi.c: In function 'nv_acpi_dsm_method': nvidia_acpi.c:166: warning: 'data_size' may be used uninitialized in this function *** [nvidia_acpi.o] Error code 1 note that this is a warning, but -Werror compiler flag is forced on (not present in make.conf). Subsequent message recommends setting MAKE_JOBS_UNSAFE=yes, but this has no effect. >How-To-Repeat: Attempt to build x11/nvidia-driver from ports. >Fix: The first usage of the data_size variable appears to be on line 203, and it is used as an "out" argument to nvidia_acpi_extract_object. That function initializes it to 0 at the beginning (line 97), so the usage is not actually unsafe. Nevertheless, initializing it to 0 at the point of declaration should have no change in behavior and suppress this warning. --- nvidia_acpi.c.orig 2013-08-27 10:11:43.149516389 -0400 +++ nvidia_acpi.c 2013-08-27 10:12:02.588515738 -0400 @@ -163,7 +163,7 @@ union acpi_object *dsm; union acpi_object dsm_input[4]; struct acpi_object_list input = { 4, dsm_input }; - uint32_t data_size; + uint32_t data_size = 0; dev = device_get_parent(nv->handle); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308271415.r7REF0s5063300>