- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

According to the standard, all elements of the result of the intrinsic functions minloc and maxloc should be 0 if their array argument is 0-sized. But with Intel Fortran the elements are 1 instead:

```
integer, allocatable :: a(:), b(:,:)
allocate(a(0), b(2,0))
print *, maxloc(a)
print *, maxloc(b)
end
```

This should print

```
0
0 0
```

But instead I get

```
1
1 1
```

This is with the latest 2021.5.0 version and goes back to at least 18.0

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Link Copied

4 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

/standard-semantics is your friend - sets /assume:noold_maxminloc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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