From owner-svn-src-projects@freebsd.org Sun Feb 21 14:47:53 2016 Return-Path: <owner-svn-src-projects@freebsd.org> Delivered-To: svn-src-projects@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 C5E2BAAFE38 for <svn-src-projects@mailman.ysv.freebsd.org>; Sun, 21 Feb 2016 14:47:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 8E69311F4 for <svn-src-projects@freebsd.org>; Sun, 21 Feb 2016 14:47:53 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 21ba7fed-d8aa-11e5-8dfb-c75234cc769e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 21 Feb 2016 14:48:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1LElhGQ003375; Sun, 21 Feb 2016 07:47:43 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1456066063.1294.40.camel@freebsd.org> Subject: Re: svn commit: r295812 - projects/mips64-clang/sys/mips/rmi From: Ian Lepore <ian@freebsd.org> To: Sean Bruno <sbruno@FreeBSD.org>, src-committers@freebsd.org, svn-src-projects@freebsd.org Date: Sun, 21 Feb 2016 07:47:43 -0700 In-Reply-To: <201602191637.u1JGb6lm055074@repo.freebsd.org> References: <201602191637.u1JGb6lm055074@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" <svn-src-projects.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/> List-Post: <mailto:svn-src-projects@freebsd.org> List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 21 Feb 2016 14:47:53 -0000 On Fri, 2016-02-19 at 16:37 +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Feb 19 16:37:06 2016 > New Revision: 295812 > URL: https://svnweb.freebsd.org/changeset/base/295812 > > Log: > Change a static const string to a #define as the strcpy() throws a > warn/error with clang. > > /home/sbruno/mips64-clang/sys/mips/rmi/xls_ehci.c:133:25: error: > format string is not a string literal (potentially insecure) > [-Werror,-Wformat-security] > sprintf(sc->sc_vendor, xlr_vendor_desc); > > Modified: > projects/mips64-clang/sys/mips/rmi/xls_ehci.c > > Modified: projects/mips64-clang/sys/mips/rmi/xls_ehci.c > ===================================================================== > ========= > --- projects/mips64-clang/sys/mips/rmi/xls_ehci.c Fri Feb 19 > 15:53:08 2016 (r295811) > +++ projects/mips64-clang/sys/mips/rmi/xls_ehci.c Fri Feb 19 > 16:37:06 2016 (r295812) > @@ -73,7 +73,7 @@ static device_attach_t ehci_xls_attach; > static device_detach_t ehci_xls_detach; > > static const char *xlr_usb_dev_desc = "RMI XLR USB 2.0 controller"; > -static const char *xlr_vendor_desc = "RMI Corp"; > +#define XLR_VENDOR_DESC "RMI Corp"; > > static int > ehci_xls_probe(device_t self) > @@ -130,7 +130,7 @@ ehci_xls_attach(device_t self) > device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); > device_set_desc(sc->sc_bus.bdev, xlr_usb_dev_desc); > > - sprintf(sc->sc_vendor, xlr_vendor_desc); > + sprintf(sc->sc_vendor, XLR_VENDOR_DESC); > > err = bus_setup_intr(self, sc->sc_irq_res, > INTR_TYPE_BIO | INTR_MPSAFE, NULL, > Bah. The compiler should understand that a static const char* is equivelent to a string literal for the purposes of this warning. That said, a sprintf() is just a strange spelling of strlcpy() here. -- Ian