Comments (10)
This is with "-fcheck=all -Wall -Wextra", which cmake uses for the Debug build type. No error with Release build type.
from petaca.
The following program demonstrates the issue, when compiled with gfortran -g -fcheck=all -Wall -Wextra junk.F90
. Interestingly, changing the reshaped shape to shape=[2,1]
, makes the error go away. As it stands, I don't think this is a major problem, since the Release build test passes (and it would fail if the assignment were getting truly messed up).
module junk
use, intrinsic :: iso_fortran_env
type, abstract, public :: parameter_entry
!! meta data associated with the parameter will go here
end type
type, extends(parameter_entry), public :: any_matrix
private
class(*), allocatable :: value(:,:)
contains
procedure :: set_value => set_matrix_value
generic :: get_value => get_matrix_int32
procedure, private :: get_matrix_int32
end type
interface any_matrix
procedure any_matrix_value
end interface
contains
function any_matrix_value (value) result (obj)
class(*), intent(in) :: value(:,:)
type(any_matrix) :: obj
call set_matrix_value (obj, value)
end function any_matrix_value
subroutine set_matrix_value (this, value)
class(any_matrix), intent(out) :: this
class(*), intent(in) :: value(:,:)
allocate(this%value(lbound(value,1):ubound(value,1),&
lbound(value,2):ubound(value,2)), source=value)
end subroutine set_matrix_value
!! Return a int32 kind integer value.
subroutine get_matrix_int32 (this, value, errc)
class(any_matrix), intent(in) :: this
integer(int32), allocatable :: value(:,:)
logical, intent(out) :: errc
select type (v => this%value)
type is (integer(int32))
value = v
errc = .false.
class default
errc = .true.
end select
end subroutine
end module
program stuff
use junk
type(any_matrix) :: x, y
call x%set_value (reshape([1,2],shape=[1,2]))
y = x
end program
from petaca.
The other thing I noticed is the slew of warning messages during compilation about variables possibly being used before defined, but they were compiler-generated variables, members of structs for array dope vectors, etc. That's not right at all.
from petaca.
Same problems for gfortran 9.1
from petaca.
@mattbement did you submit a bug report with your reproducer code? That seems small enough, and the problem large enough, that it should get some traction. Please let me know if you want/need help and ping me with a link to the bug tracker if you are able to get around to submitting it. If you don't have time let me know an I can do it.
Thanks!
from petaca.
@zbeekman - I've not submitted to gcc bugzilla before - so if you're willing, that would be great!
from petaca.
The other thing I noticed is the slew of warning messages during compilation about variables possibly being used before defined, but they were compiler-generated variables, members of structs for array dope vectors, etc. That's not right at all.
Yes this is very annoying. It would be a super useful warning if it weren't for all the false positives/errant output. I've taken to adding -Wno-maybe-undefined
from petaca.
I have 9.1.1 version and
Test project /home/term/Programs/petaca/petaca/build
Start 1: fortran_dynamic_loader
1/20 Test #1: fortran_dynamic_loader ........... Passed 0.04 sec
Start 2: map_any
2/20 Test #2: map_any .......................... Passed 0.01 sec
Start 3: any_scalar
3/20 Test #3: any_scalar ....................... Passed 0.00 sec
Start 4: any_vector
4/20 Test #4: any_vector ....................... Passed 0.00 sec
Start 5: any_matrix
5/20 Test #5: any_matrix ....................... Passed 0.01 sec
Start 6: parameter_list
6/20 Test #6: parameter_list ................... Passed 0.00 sec
Start 7: parameter_list_json
7/20 Test #7: parameter_list_json .............. Passed 0.00 sec
Start 8: state_history
8/20 Test #8: state_history .................... Passed 0.00 sec
Start 9: secure_hash
9/20 Test #9: secure_hash ...................... Passed 0.50 sec
Start 10: timer_tree
10/20 Test #10: timer_tree ....................... Passed 2.19 sec
Start 11: strip-file1
11/20 Test #11: strip-file1 ...................... Passed 0.01 sec
Start 12: json-ex1
12/20 Test #12: json-ex1 ......................... Passed 0.00 sec
Start 13: json-ex2
13/20 Test #13: json-ex2 ......................... Passed 0.00 sec
Start 14: json-ex3
14/20 Test #14: json-ex3 ......................... Passed 0.00 sec
Start 15: json-ex4
15/20 Test #15: json-ex4 ......................... Passed 0.00 sec
Start 16: json-ex5
16/20 Test #16: json-ex5 ......................... Passed 0.00 sec
Start 17: json-ex6
17/20 Test #17: json-ex6 ......................... Passed 0.00 sec
Start 18: json-ex7
18/20 Test #18: json-ex7 ......................... Passed 0.00 sec
Start 19: json-ex8
19/20 Test #19: json-ex8 ......................... Passed 0.00 sec
Start 20: json-ex9
20/20 Test #20: json-ex9 ......................... Passed 0.00 sec
100% tests passed, 0 tests failed out of 20
gfortran --version
GNU Fortran (SUSE Linux) 9.1.1 20190527 [gcc-9-branch revision 271644]
from petaca.
Forgive a dumb question - this is the debug build?
from petaca.
ok, you are right, I forgot to switch to debug :/
Test project /home/term/Programs/petaca/petaca/build
Start 1: fortran_dynamic_loader
1/20 Test #1: fortran_dynamic_loader ........... Passed 0.04 sec
Start 2: map_any
2/20 Test #2: map_any .......................... Passed 0.00 sec
Start 3: any_scalar
3/20 Test #3: any_scalar ....................... Passed 0.00 sec
Start 4: any_vector
4/20 Test #4: any_vector ....................... Passed 0.00 sec
Start 5: any_matrix
5/20 Test #5: any_matrix .......................***Failed 0.02 sec
Start 6: parameter_list
6/20 Test #6: parameter_list ...................***Failed 0.01 sec
Start 7: parameter_list_json
7/20 Test #7: parameter_list_json .............. Passed 0.00 sec
Start 8: state_history
8/20 Test #8: state_history .................... Passed 0.00 sec
Start 9: secure_hash
9/20 Test #9: secure_hash ...................... Passed 0.41 sec
Start 10: timer_tree
10/20 Test #10: timer_tree ....................... Passed 2.42 sec
Start 11: strip-file1
11/20 Test #11: strip-file1 ...................... Passed 0.06 sec
Start 12: json-ex1
12/20 Test #12: json-ex1 ......................... Passed 0.00 sec
Start 13: json-ex2
13/20 Test #13: json-ex2 ......................... Passed 0.00 sec
Start 14: json-ex3
14/20 Test #14: json-ex3 ......................... Passed 0.00 sec
Start 15: json-ex4
15/20 Test #15: json-ex4 ......................... Passed 0.00 sec
Start 16: json-ex5
16/20 Test #16: json-ex5 ......................... Passed 0.00 sec
Start 17: json-ex6
17/20 Test #17: json-ex6 ......................... Passed 0.00 sec
Start 18: json-ex7
18/20 Test #18: json-ex7 ......................... Passed 0.00 sec
Start 19: json-ex8
19/20 Test #19: json-ex8 ......................... Passed 0.00 sec
Start 20: json-ex9
20/20 Test #20: json-ex9 ......................... Passed 0.00 sec
90% tests passed, 2 tests failed out of 20
from petaca.
Related Issues (20)
- Is timer_tree::stop error return needed?
- User-specified kinds when creating parameter lists from JSON text
- JSON input of arrays of parameter lists
- "set" procedure not accepting input of parameter_list type HOT 5
- gfortran 8.3.1 fails parameter_list_type test HOT 3
- Compiling with the flang compiler HOT 1
- Use JSONPath style syntax for parameter list names HOT 2
- Parameter list methods return allocated 0-length errmsg when stat==0
- Intel 19 regression HOT 1
- Intel 19.1 regression HOT 1
- Test failures on Mac w/NAG HOT 1
- GCC 9+ loses dynamic type for non-scalar parameters in parameter list HOT 1
- Error message is not returned correctly by gfortran 9+ HOT 10
- version tag HOT 2
- ICE when compiling with Intel ifx HOT 1
- Unit tests for parameter_list_json HOT 1
- TYPE_IS inquiry methods for parameter list
- Report INTEL_BUG20140921 HOT 1
- Replace CALL EXIT with standard STOP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from petaca.