- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following non-conforming code is accepted by ifort/ifx, but gives a warning only with "ifort -stand" (not with ifx) and only for one variant:
program p
implicit none
type t1
integer :: g = 0
end type t1
type t2
integer :: g
end type t2
type(t1) :: u1 = t1(1)
type(t2) :: u2 = t2(2) ! <- Warning only here, w/ ifort -stand
data u1%g /3/ ! <- conflicting initialization
data u2%g /4/ ! <- conflicting initialization
print *, u1%g, u2%g
end program p
While NAG rejects both data statements (with slightly different error messages), Intel gives:
% ifx ifort-data2.f90 -stand
(silent = no warning at all)
% ifort ifort-data2.f90 -stand
ifort-data2.f90(10): warning #5436: Overlapping storage initializations encountered with U2
type(t2) :: u2 = t2(2) ! <- Warning only here, w/ ifort -stand
----------------------^
While it is nice to have at least one warning here, it points to the wrong place: it is not the declaration that is at fault, it is the data statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifx 2024.1 now prints a warning message for this reproducer. This version was released last week. Please try it out!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting this. I filed a bug, COMPLRLLVM-50053. I'll let you know when a fix is available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifx 2024.1 now prints a warning message for this reproducer. This version was released last week. Please try it out!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's debatable which line to warn on - the declaration or the data statement - but now warnings are issued with -stand .
Thanks!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page