From owner-svn-src-all@freebsd.org Wed May 15 07:51:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4577E15AE64C; Wed, 15 May 2019 07:51:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE1B380148; Wed, 15 May 2019 07:51:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8BA26AFC; Wed, 15 May 2019 07:51:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4F7pUp6031427; Wed, 15 May 2019 07:51:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4F7pUMh031426; Wed, 15 May 2019 07:51:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905150751.x4F7pUMh031426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 15 May 2019 07:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347610 - in stable/11/usr.sbin/lpr: common_source lpc X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.sbin/lpr: common_source lpc X-SVN-Commit-Revision: 347610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE1B380148 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 07:51:31 -0000 Author: ngie Date: Wed May 15 07:51:30 2019 New Revision: 347610 URL: https://svnweb.freebsd.org/changeset/base/347610 Log: MFC r320009,r347075: r320009 (by sbruno): Quiesce clang warning while building lpc. usr.sbin/lpr/lpc/lpc.c Warning passing 'char *[20]' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] Fix: Explicitly cast the variable "margv" to const char ** only for it's use as a parameter to suppress the error r347075: Fix `clang -Wcast-qual` issues Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb` variable. This unblocks ^/projects/runtime-coverage-v2 from building cleanly on universe13a.freebsd.org. I suspect the issue was introduced through some changes to `bsd.*.mk` inclusion on the branch, which I will continue to investigate/isolate. Tested with: clang 8 (arm64) Modified: stable/11/usr.sbin/lpr/common_source/printcap.c stable/11/usr.sbin/lpr/lpc/lpc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/lpr/common_source/printcap.c ============================================================================== --- stable/11/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:46:17 2019 (r347609) +++ stable/11/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:51:30 2019 (r347610) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); /* * Routines and data used in processing the printcap file. */ -static char *printcapdb[2] = { _PATH_PRINTCAP, 0 }; /* list for cget* */ +static char *printcapdb[] = { __DECONST(char *, _PATH_PRINTCAP), NULL }; static char *capdb_canonical_name(const char *_bp); static int capdb_getaltlog(char *_bp, const char *_shrt, @@ -97,15 +97,9 @@ int getprintcap(const char *printer, struct printer *pp) { int status; - char *XXX; char *bp; - /* - * A bug in the declaration of cgetent(3) means that we have - * to hide the constness of its third argument. - */ - XXX = (char *)printer; - if ((status = cgetent(&bp, printcapdb, XXX)) < 0) + if ((status = cgetent(&bp, printcapdb, printer)) < 0) return status; status = getprintcap_int(bp, pp); free(bp); @@ -378,10 +372,10 @@ capdb_getaltstr(char *bp, const char *shrt, const char { int status; - status = cgetstr(bp, (char *)/*XXX*/lng, result); + status = cgetstr(bp, lng, result); if (status >= 0 || status == PCAPERR_OSERR) return status; - status = cgetstr(bp, (char *)/*XXX*/shrt, result); + status = cgetstr(bp, shrt, result); if (status >= 0 || status == PCAPERR_OSERR) return status; if (dflt) { @@ -402,10 +396,10 @@ capdb_getaltnum(char *bp, const char *shrt, const char { int status; - status = cgetnum(bp, (char *)/*XXX*/lng, result); + status = cgetnum(bp, lng, result); if (status >= 0) return status; - status = cgetnum(bp, (char *)/*XXX*/shrt, result); + status = cgetnum(bp, shrt, result); if (status >= 0) return status; *result = dflt; @@ -419,9 +413,9 @@ capdb_getaltnum(char *bp, const char *shrt, const char static int capdb_getaltlog(char *bp, const char *shrt, const char *lng) { - if (cgetcap(bp, (char *)/*XXX*/lng, ':')) + if (cgetcap(bp, lng, ':')) return 1; - if (cgetcap(bp, (char *)/*XXX*/shrt, ':')) + if (cgetcap(bp, shrt, ':')) return 1; return 0; } Modified: stable/11/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- stable/11/usr.sbin/lpr/lpc/lpc.c Wed May 15 07:46:17 2019 (r347609) +++ stable/11/usr.sbin/lpr/lpc/lpc.c Wed May 15 07:51:30 2019 (r347610) @@ -197,7 +197,7 @@ cmdscanner(void) makeargv(); if (margc == 0) continue; - if (el != NULL && el_parse(el, margc, margv) != -1) + if (el != NULL && el_parse(el, margc, (const char **)margv) != -1) continue; c = getcmd(margv[0]);