From owner-svn-src-head@freebsd.org Wed Jun 24 13:12:37 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 EC2A034E06F; Wed, 24 Jun 2020 13:12:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 49sNq95xppz47B7; Wed, 24 Jun 2020 13:12:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C20AD20678; Wed, 24 Jun 2020 13:12:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f176.google.com with SMTP id l17so1686798qki.9; Wed, 24 Jun 2020 06:12:37 -0700 (PDT) X-Gm-Message-State: AOAM531nYm9GlIdak8eZ0pf25I3SOqU5dDy1SKTjWq+CpvU2ZstyKSch RjaR6ks10Vn+t+gua802cnRKXHL8ye++HMZ1gOk= X-Google-Smtp-Source: ABdhPJwNBXFlQCM5Ds7HVts7Oo1mSTMVfJd84K2k0sl7+MLvcV7XsAqMwtzGhbIadRN8LfMMmmsnZpUUqZyQY+0F0Y8= X-Received: by 2002:a05:620a:218e:: with SMTP id g14mr8696126qka.430.1593004357398; Wed, 24 Jun 2020 06:12:37 -0700 (PDT) MIME-Version: 1.0 References: <202006181809.05II9G8p054025@repo.freebsd.org> <2FBF81D0-9EA3-4F46-9E3E-7EDE852962C1@FreeBSD.org> In-Reply-To: <2FBF81D0-9EA3-4F46-9E3E-7EDE852962C1@FreeBSD.org> From: Kyle Evans Date: Wed, 24 Jun 2020 08:12:27 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib To: Dimitry Andric Cc: Jung-uk Kim , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" 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 13:12:38 -0000 On Wed, Jun 24, 2020 at 5:09 AM Dimitry Andric wrote: > > On 24 Jun 2020, at 02:41, 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. > > This is a strange one. As gcc6 has been removed from ports, I had to > resort to an older 12-STABLE box which still had it, but no matter what > I try, I cannot get the warning that is being produced by the CI system. > What does it do differently? > > Also, the warning is indeed bogus, as strrchr() returns a non-const char > pointer. As I can't reproduce it, I also can't verify which gcc version > fixes the bogus warning. > It's bogus, but it's also not-even-wrong given that strrchr doesn't do anything to make it actually safe to mutate *strrchr() in a scenario like this where the input is apparently a string literal. I consider it an anti-footgun measure to make sure we've constified slash here. Thanks, Kyle Evans