From owner-svn-src-head@freebsd.org Fri Feb 3 16:49:28 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 8A1DACCE3B0 for ; Fri, 3 Feb 2017 16:49:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4891D19 for ; Fri, 3 Feb 2017 16:49:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id e137so2187463itc.0 for ; Fri, 03 Feb 2017 08:49:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9Bqg0sdApvwXTZQRFDJK/1JtfJnK2GKvsRHavnGPzvI=; b=CNsL9y+8veBDI6BXsTunVYR2FoLAI+EgcPgonH0sdFqIapjX6Bxfh46icHHhmWIEwT T0kdfx8TxhoQptgbesFBc87T1wqoeNCYcJ61TcJFhbjY2VuYeMhEWCpyFwAib1UQzrhf qNwqTtqra43Mn1cmqf1sw6wL6/iv3+VzpprHJioRefORXSL0FbyT4ydIR/27N6EhYnzN hy9eDzLl0uzvdFo9Rg6qRyzYiSeTWUa465TUtxQbmkw5y2xxLsfRJxfEl4Wu952cfaXa AB32k70qdXFQRWIjovTRtlf/ta4IzYy+h9vmXa0HzIyB+eLfZMus5WmSV5O9EcX1uNCy Db1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9Bqg0sdApvwXTZQRFDJK/1JtfJnK2GKvsRHavnGPzvI=; b=QHzzLkUGH4CuWrv4968e9AwdEQkI8VoHWa0brNJ4nhLjyAa8okm0kpxBlWGm0uNYHK sx1AM2fw4Ffsyhuyb1ymAZlfHZOoEUOLSr53vogQEMRfvG9SXFOTeQG5ydBpR96n+Dyb Dguatvuf5ygxrwAmWA4csBQug09x8HSZICtogEbhO2T5FBREJZE+tOr2UrftW/sjh+vh h3QfGdWrH0g6jSBls7kHrizK9XRt3V9TAyUZmB6CZAvuGoLIDlXf7UvRgcIw00f/iNdb peqsBdtynAdZFRdlG3qVpxZYfUaw9lplD4B/rD63qRGt91eEv0w/GLKqqhFxzVevegOr A8Pg== X-Gm-Message-State: AIkVDXJ2OaAmx7uF8yKyAXg95iACqp01lE7aGDzeXK0TTsNuDX4ztvVbsDuu/8aXdT84rO86Opz4t2sPr1/UrA== X-Received: by 10.36.135.194 with SMTP id f185mr1729441ite.85.1486140567619; Fri, 03 Feb 2017 08:49:27 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Fri, 3 Feb 2017 08:49:27 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <1486140447.3017.189.camel@freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> From: Warner Losh Date: Fri, 3 Feb 2017 09:49:27 -0700 X-Google-Sender-Auth: drL7QisL4-XDiROGwtxjolJ7lZM Message-ID: Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi To: Ian Lepore Cc: Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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:49:28 -0000 On Fri, Feb 3, 2017 at 9:47 AM, Ian Lepore wrote: > 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. Because clang's understanding of %S in the bootloader doesn't match how it's actually used and there's no casting that will fix that. Warner > -- 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); >> >