Skip to content

Commit 45b1498

Browse files
authored
Fix --show-model, init c_source%parent_modules. (#712)
1 parent ffc7b6c commit 45b1498

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/fpm_source_parsing.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ function parse_c_source(c_filename,error) result(c_source)
463463

464464
allocate(c_source%modules_used(0))
465465
allocate(c_source%modules_provided(0))
466+
allocate(c_source%parent_modules(0))
466467

467468
open(newunit=fh,file=c_filename,status='old')
468469
file_lines = read_lines(fh)

test/fpm_test/test_source_parsing.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,11 @@ subroutine test_csource(error)
818818
call test_failed(error,'Unexpected link_libraries - expecting unallocated')
819819
return
820820
end if
821+
822+
if (size(f_source%parent_modules) /= 0) then
823+
call test_failed(error,'Incorrect number of parent_modules - expecting zero')
824+
return
825+
end if
821826

822827
if (.not.('proto.h' .in. f_source%include_dependencies)) then
823828
call test_failed(error,'Missing file in include_dependencies')

0 commit comments

Comments
 (0)