This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Jul 2018 10:34:18 +0200
- Subject: Re: [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- References: <email@example.com>
On Wed, Jul 25, 2018 at 4:07 AM Martin Sebor <firstname.lastname@example.org> wrote:
> The very large option argument enhancement committed last week
> inadvertently introduced an assumption about the LP64 data model
> that makes the -Wxxx-larger-than options have a different effect
> at their default documented setting of PTRDIFF_MAX between ILP32
> and LP64. As a result, the options are treated as suppressed in
> ILP32 while triggering the expected warnings for allocations or
> sizes in excess of the limit in ILP64.
> To remove this I considered making it possible to use symbolic
> constants like PTRDIFF_MAX as the option arguments so that
> then defaults in the .opt files could be set to that. Sadly,
> options in GCC are processed before the values of constants
> like PTRDIFF_MAX for the target are known, and deferring
> the handling of just the -Wxxx-larger-than= options until
> the constants have been computed would be too involved to
> make it worth the effort.
> To keep things simple I decided to have the code that handles
> each of the affected options treat the HOST_WIDE_INT_MAX default
> as a special request to substitute the value of PTRDIFF_MAX at
> the time.
> The attached patch implements this.
I wonder if documenting a special value of -1 would be easier for
users to use. Your patch doesn't come with adjustments to
invoke.texi so I wonder how people could know of this special
> Tested on x86_64-linux with -m32/-m64.