This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR 47359 - warnings for constant conversion
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 1 Jun 2015 13:10:48 -0700
- Subject: Re: [patch, fortran] PR 47359 - warnings for constant conversion
- Authentication-results: sourceware.org; auth=none
- References: <556B7ED1 dot 4020304 at netcologne dot de> <20150531221425 dot GA34602 at troutmask dot apl dot washington dot edu> <556BFCF0 dot 5030607 at netcologne dot de> <20150601134017 dot GA37949 at troutmask dot apl dot washington dot edu> <556C9E11 dot 4090502 at netcologne dot de>
On Mon, Jun 01, 2015 at 08:01:53PM +0200, Thomas Koenig wrote:
> Am 01.06.2015 um 15:40 schrieb Steve Kargl:
> > On Mon, Jun 01, 2015 at 08:34:24AM +0200, Thomas Koenig wrote:
> >> What would be the peferred alternative?
>
> > Is it possible to detect the _knd suffix?
>
> Yes, this is possible.
>
> > If so, no
> > warning is my preference as it is never incorrect to
> > specify more digits than required for conversion from
> > ASCII to an internal representation. This, of course,
> > assumes that the compiler doesn't have a bug.
>
> :-)
>
> >> >
> >> > Comments?
> >> >
> > I'm not a big fan of a proliferation of options. As long
> > as the warning isn't triggered under -Wall, I suppose
> > I can live with -Wconversion-extra.
>
> OK, so we have a few options.
>
> a) Warn for
>
> print *,3.1415926535897932 with -Wconversion
>
> and warn for
>
> print *,3.1415926535_4 only with -Wconversion-extra
>
> b) Like a) but supply two options to switch off the respective
> warnings.
>
> c) Warn for
>
> print *,3.1415926535 with -Wconversion-extra
>
> and don't warn for
>
> print *,3.141592653589_4
>
This would be my first choice. If a user actually specifies
a suffix, I assume that the user has given some thought
to the preceding digits.
> d) Like now: Warn with -Wconversion-extra for both
>
> print *,3.1415926535
>
> and
>
> print *,3.14159265358979_4
This would be my second choice.
> What are people's prefrences on this? Should we maybe ask on c.l.f
> (where we will get more opinions, certainly also differing)?
If you ask on c.l.f, you'll get differing opinions and most likely
a history lesson on what compilers did 40 years ago and how
PL/1 hands the issue. :-)
Don't let my person opinion be the sole driver/impediment.
I do have a few comments on the patch itself. I'll send those
later.
--
Steve