From owner-svn-src-head@freebsd.org Fri Feb 3 16:47:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D20CCE31F for ; Fri, 3 Feb 2017 16:47:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D40C1B7F for ; Fri, 3 Feb 2017 16:47:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6fc5cc85-ea30-11e6-b3c2-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 6fc5cc85-ea30-11e6-b3c2-c9f38144898e; Fri, 03 Feb 2017 16:47:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v13GlR1l024277; Fri, 3 Feb 2017 09:47:27 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1486140447.3017.189.camel@freebsd.org> Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 03 Feb 2017 09:47:27 -0700 In-Reply-To: <201702031639.v13GdAXQ074031@repo.freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:47:30 -0000 On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: > Author: tsoome > Date: Fri Feb  3 16:39:10 2017 > New Revision: 313166 > URL: https://svnweb.freebsd.org/changeset/base/313166 > > Log: >   loader: libefi/env.c warnings in arm build >    >   The arm build has revealed some of the warnings, the fix for CHAR16 >   warning is to switch the warning off for env.c (same as for > efinet.c). >    How is disabling the warning instead of just fixing it the right thing to do?  I think disabling a printf format warning is never the right thing to do, it just turns a compile warning into a runtime failure. -- Ian >   For error code we need to use macro. >    >   Reported by: gjb >   Reviewed by: imp >   Approved by: imp (mentor) >   Differential Revision: https://reviews.freebsd.org/D9422 > > Modified: >   head/sys/boot/efi/libefi/Makefile >   head/sys/boot/efi/libefi/env.c > > Modified: head/sys/boot/efi/libefi/Makefile > ===================================================================== > ========= > --- head/sys/boot/efi/libefi/Makefile Fri Feb  3 16:36:14 2017 > (r313165) > +++ head/sys/boot/efi/libefi/Makefile Fri Feb  3 16:39:10 2017 > (r313166) > @@ -26,6 +26,7 @@ SRCS+= time_event.c >  # of a short. There's no good cast to use here so just ignore the >  # warnings for now. >  CWARNFLAGS.efinet.c+= -Wno-format > +CWARNFLAGS.env.c+= -Wno-format >   >  .if ${MACHINE_CPUARCH} == "aarch64" >  CFLAGS+= -msoft-float -mgeneral-regs-only > > Modified: head/sys/boot/efi/libefi/env.c > ===================================================================== > ========= > --- head/sys/boot/efi/libefi/env.c Fri Feb  3 16:36:14 2017 > (r313165) > +++ head/sys/boot/efi/libefi/env.c Fri Feb  3 16:39:10 2017 > (r313166) > @@ -94,14 +94,16 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU >   status = RS->GetVariable(varnamearg, matchguid, &attr, >       &datasz, NULL); >   if (status != EFI_BUFFER_TOO_SMALL) { > - printf("Can't get the variable: error %#lx\n", > status); > + printf("Can't get the variable: error %#lx\n", > +     EFI_ERROR_CODE(status)); >   return (CMD_ERROR); >   } >   data = malloc(datasz); >   status = RS->GetVariable(varnamearg, matchguid, &attr, >       &datasz, data); >   if (status != EFI_SUCCESS) { > - printf("Can't get the variable: error %#lx\n", > status); > + printf("Can't get the variable: error %#lx\n", > +     EFI_ERROR_CODE(status)); >   return (CMD_ERROR); >   } >   uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); >