https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90536

--- Comment #5 from Jonathan Ravens <j.ravens.nz at gmail dot com> ---
(In reply to Dominique d'Humieres from comment #3)
> To make the story short: compile your code with -Wno-conversion as a work
> around.
> 
> This is needed starting with at least 4.6.0 revision r161462 (2010-06-27),
> but not needed with 4.5.4 or earlier.
> 
> Note that BYTE and '89'X are GNU extensions and not standard conforming.
> 
> IMO this PR is INVALID.

Hi Dominique, I agree that 'BYTE and '89'X' are not standard conforming, and
it's true that using -Wno-conversion does effect a workaround.  However BYTE
and '01'X (for example) should not raise a warning, so I think that part of my
report is valid.

Simpler code to illustrate this :

        program test
        byte b1 / '01'X /
        b1 = 2
        end

> gfortran -c -Wall -fno-range-check gfortran_bug_2.f
gfortran_bug_2.f:2.23:

        byte b1 / '01'X /                                               
                       1
Warning: Possible change of value in conversion from INTEGER(16) to INTEGER(1)
at (1)
gfortran_bug_2.f:3.13:

        b1 = 2                                                          
             1
Warning: Possible change of value in conversion from INTEGER(4) to INTEGER(1)
at (1)

Reply via email to