From owner-svn-src-head@freebsd.org Wed Jun 24 01:49:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF89933FB2B; Wed, 24 Jun 2020 01:49:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49s5fl5d0Vz4Pmg; Wed, 24 Jun 2020 01:49:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id AC7AD1B917; Wed, 24 Jun 2020 01:49:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <202006181809.05II9G8p054025@repo.freebsd.org> From: Jung-uk Kim Autocrypt: addr=jkim@FreeBSD.org; keydata= mQENBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnx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D3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Organization: FreeBSD.org Message-ID: <9371c80b-1038-489b-6998-feb5013d6257@FreeBSD.org> Date: Tue, 23 Jun 2020 21:49:16 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 24 Jun 2020 01:49:19 -0000 On 20. 6. 23., Kyle Evans wrote: > On Tue, Jun 23, 2020 at 8:07 PM Jung-uk Kim wrote: >> >> On 20. 6. 23., Kyle Evans wrote: >>> On Thu, Jun 18, 2020 at 1:09 PM Jung-uk Kim wrote: >>>> >>>> Author: jkim >>>> Date: Thu Jun 18 18:09:16 2020 >>>> New Revision: 362333 >>>> URL: https://svnweb.freebsd.org/changeset/base/362333 >>>> >>>> Log: >>>> MFV: r362286 >>>> >>>> Merge flex 2.6.4. >>>> >>> >>> Hi, >>> >>> I'm looking at getting amd64 world buildable again by gcc6; this seems >>> to give it some gas: >>> >>> /usr/src/contrib/flex/src/main.c: In function 'check_options': >>> /usr/src/contrib/flex/src/main.c:347:14: error: assignment discards >>> 'const' qualifier from pointer target type >>> [-Werror=discarded-qualifiers] >>> if ((slash = strrchr(M4, '/')) != NULL) { >>> >>> The following trivial patch seems to make gcc6 happy again. >>> >>> diff --git a/contrib/flex/src/main.c b/contrib/flex/src/main.c >>> index 711e387b1b5..97e043c6275 100644 >>> --- a/contrib/flex/src/main.c >>> +++ b/contrib/flex/src/main.c >>> @@ -342,7 +342,7 @@ void check_options (void) >>> /* Setup the filter chain. */ >>> output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); >>> if ( !(m4 = getenv("M4"))) { >>> - char *slash; >>> + const char *slash; >>> m4 = M4; >>> if ((slash = strrchr(M4, '/')) != NULL) { >>> m4 = slash+1; >> >> Hmm... It looks like a false positive and I am little reluctant to >> change the vendor code. >> >> Can you just add "-Wno-discarded-qualifiers" or something to >> CWARNFLAGS.gcc in share/mk/bsd.sys.mk for some WARNS level? >> > > Do we not have a working relationship with an upstream on this one to > sort it out? Not really. You may file an issue or a pull request but I don't see much activity from the author recently. https://github.com/westes/flex Jung-uk Kim > It's debatably correct; M4 is effectively a const string (string > literal, as far as I can tell) and strrchr promises a little more than > it should because we really shouldn't mutate the result in that kind > of scenario. In this case, the result isn't mutated, but it certainly > looks like it could be with the current declaration of slash.