Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2020 21:07:23 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib
Message-ID:  <a8f2b5c1-daed-57bf-d0a8-a9d117673d13@FreeBSD.org>
In-Reply-To: <CACNAnaG4AsyQhXDW%2BOBOs7iC13_8n5FaqRRg3YZk57Sow0SBcA@mail.gmail.com>
References:  <202006181809.05II9G8p054025@repo.freebsd.org> <CACNAnaG4AsyQhXDW%2BOBOs7iC13_8n5FaqRRg3YZk57Sow0SBcA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20. 6. 23., Kyle Evans wrote:
> On Thu, Jun 18, 2020 at 1:09 PM Jung-uk Kim <jkim@freebsd.org> 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?

Jung-uk Kim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a8f2b5c1-daed-57bf-d0a8-a9d117673d13>