- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the same common block in several subroutines located in multiple files. I get a link error, viz:
ld:0:0 warning: for symbol _iodev_ tentative definition of size 16 from WRT.o is being replaced by a real definition of size 12 from PINPUT1.o
the common block and variable definitions are
integer*4 in,out
logical*4 pinputerr
common /iodev/ in, out, pinputerr
Why is the linker concerned and how can the code be modified to eliminate this warning? Thanks. P.W.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.
Thanks - The variable and common definitions were cut and pasted into each routine to ensure uniformity, but I replaced that code with an include - problem persisted. I noted the data statement below which I replaced with explicit run-time inits of "in" and "out", and the problem disappeared. P.W.
data in, out, ind1, ind2, ind3, outd1, outd2, outd3
& / 5, 6, 4, 3, 2, 7, 8, 9 /
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting. COMMON initialization should take place in a BLOCK DATA subprogram.

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