- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider the following minimal working example:
program p
character(len=:),allocatable::c
c='t'
print*,f(c)
contains
logical function f(c) ! works for `integer` and numerical value of `c`
character(len=*),intent(in)::c
read(c,*)f
end
end
The code was compiled with `ifx 2024.2.1` and flags `-O2 -g -fsanitize=memory`. The executable exits with an error `MemorySanitizer: use-of-uninitialized-value for_rint_lis.c in ri_find_field` and an info `Uninitialized value was created by a heap allocation` pointing to line 3 before that. I suppose, it is a false positive, because replacing `logical` with `integer` in line 6 and changing the value of `c` to a numerical value fixes the issue.
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page