- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a legacy code with 1200 subroutines that I am porting to IVF. One of them is a recursive subroutine (it invokes itself). The code has historically required the -static flag (for other compilers) to be set, so that variables are initialized to zero and retain their values from one subroutine call to the next. Strict definition of "static" aside, functionalneed is(1) initialization to zero, and (2) retention of value. I have set the IVF compiler flags to: /recursive /Qsave /Qzero
My problem: in IVF /recursive over-rides /Qsave (makes it /Qauto I think), so one cannot just set /recursive and /Qsave at the project level (it compiles and links but has runtime errors due to lack of /Qsave).
In an attempt to get both /recursive and /Qsave, I have tried:
(A) setting /Qsave at the project level, removing /recursive from the project level, and setting /recursive for the file only. Although the image is not normally that big, I get:
LINK : fatal error LNK1248: image size (11F6096A0) exceeds maximum allowable size (80000000).
LINK : fatal error LNK1248: image size (11F6096A0) exceeds maximum allowable size (80000000).
(B) putting the recursive routine in a separate static library with /recursive in the library project, and linking it to the main code which has /recursive off. Result: the same link error (image size)
Any ideas on how to solve this problem? A few questions:
(1) Is there a way to have /recursive apply just to the recursive file and have /Qsave and /Qzero apply elsewhere?
(2) Separate but related, is there a way to have all variables (scalar and arrays) initialized to zero?
(3) In CVF there was a staticimage size limit of ~200MB (or something like that). The image size error in IVF implies that the limit is now ~2GB, if one reads the 80000000 as a hex number. Has the CVF small image size limitation been (in effect) removed in IVF?
Thanks
John
John
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First of all, making variables static does not initialize them to zero. It did not in CVF and does not in IVF. If you want variables initialized to zero, then say so in the code. If you use an initialization specification in the code (DATA or an initializer in the declaration), the variables then have the SAVE attribute so they will retain their value. Please don't try to patch up incorrect code with switches. You can (and should) also use the SAVE attribute explicitly so that people reading the code know what to expect.
CVF did not have a 200MB limit - Windows 95 did, and the older linker warned you about that. As of VS.NET 2002, MS did away with that warning. 2GB is the theoretical limit for code and static data in 32-bit Windows, though in practice it is somewhat less.
You seem to have done something to create much larger arrays than you had before, hence the fatal link error. You'll have to figure out where that is.
I would suggest using the RECURSIVE keyword on routines rather than the /recursive switch. The more you put in your code, the more maintainable your code will be. Switches are "big hammers" often with big effects.
CVF did not have a 200MB limit - Windows 95 did, and the older linker warned you about that. As of VS.NET 2002, MS did away with that warning. 2GB is the theoretical limit for code and static data in 32-bit Windows, though in practice it is somewhat less.
You seem to have done something to create much larger arrays than you had before, hence the fatal link error. You'll have to figure out where that is.
I would suggest using the RECURSIVE keyword on routines rather than the /recursive switch. The more you put in your code, the more maintainable your code will be. Switches are "big hammers" often with big effects.

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