Skip to content

Commit ad69e28

Browse files
committed
gcc-10 fix: explicit character allocation
1 parent db45d55 commit ad69e28

File tree

1 file changed

+3
-3
lines changed
  • example_packages/features_per_compiler/app

1 file changed

+3
-3
lines changed

example_packages/features_per_compiler/app/main.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ program main
88
integer :: failed_checks
99

1010
! Get compiler flags used to build this file
11-
options_str = compiler_options()
11+
allocate(options_str, source=compiler_options())
1212

1313
! Display compiler information
1414
print '(a)', '================================='
@@ -17,7 +17,7 @@ program main
1717
print '(a)', ''
1818

1919
! Detect compiler type using the function
20-
detected_compiler = compiled_with()
20+
allocate(detected_compiler, source=compiled_with())
2121

2222
print '(2a)', 'Detected compiler: ', detected_compiler
2323
print '(a)', ''
@@ -97,7 +97,7 @@ function compiled_with() result(msg)
9797
character(len=:), allocatable :: msg
9898
character(len=:), allocatable :: version_str
9999

100-
version_str = compiler_version()
100+
allocate(version_str, source=compiler_version())
101101

102102
if (index(version_str, 'GCC') > 0) then
103103
msg = 'gfortran'

0 commit comments

Comments
 (0)