Pascal copiler generated %init function (192 Views)
Reply
Occasional Visitor
Krister Spandau Junker
Posts: 3
Registered: ‎06-04-2007
Message 1 of 7 (192 Views)

Pascal copiler generated %init function

My alpha/vms pascal compiler has started to automaticly generate init routines.

If I give the command

$Lib/lis/full/names DATA$DISK:[LIBRARY]TSTLIB.OLB

I get:

Module ERR_ROUTINES Ident 01 Inserted 21-JUL-2006 13:44:19 2 symbols
ERR_DISPLAY
ERR_ROUTINES%INIT

I used to get:

Module ERR_ROUTINES Ident 01 Inserted 30-JUN-2006 11:20:30 1 symbol
ERR_DISPLAY

How can I get rid of the %INIT function?
Honored Contributor
Duncan Morris
Posts: 666
Registered: ‎08-07-2003
Message 2 of 7 (192 Views)

Re: Pascal copiler generated %init function

Hi,

it might help us if you could specify the version of your pascal compiler, and whether it has changed recently?

If you could also supply an example of the command line used to compile the module, that would help.

If you could generate a simple routine which demonstrates your problem, then you could attach it as a .txt document, which everybody could read.

See the reference manual section 3.3 on page 3-5 for details of the compiler generation of xxxx%INIT modules.

http://h71000.www7.hp.com/doc/82final/6083/aa-pwvsd-tk.pdf


Duncan
Respected Contributor
John Reagan
Posts: 131
Registered: ‎05-30-2004
Message 3 of 7 (192 Views)

Re: Pascal copiler generated %init function

%INIT routines on modules are there to support things like

- TO BEGIN DO
- TO END DO
- module level schema

Have you added any of these features to your Pascal application lately?

The compiler's logic for "when" to create %INIT routines has not changed much in recent times.
Occasional Visitor
Krister Spandau Junker
Posts: 3
Registered: ‎06-04-2007
Message 4 of 7 (192 Views)

Re: Pascal copiler generated %init function

The only change of the program is that
I added a TIMESTAMP variable to a
log-function

To get the time-stamp, the function
GETTIMESTAMP was used

The log-function is a hidden function in a module that has the ENVIRONMENT attribute

All compilation units that include the PEN-file above will get the %INIT-functions

If I remove GETTIMESTAMP no init-functions are created.

How can I get a time-stamp whithout getting the %init-functions?
Honored Contributor
Hein van den Heuvel
Posts: 6,588
Registered: ‎05-19-2003
Message 5 of 7 (192 Views)

Re: Pascal copiler generated %init function

>> All compilation units that include the PEN-file above will get the %INIT-functions
:
>> If I remove GETTIMESTAMP no init-functions are created.

So there's your solution :^)
You did without so long, why change now!

>> How can I get a time-stamp whithout getting the %init-functions?

Just curious... why does it bother you?
You asked the compiler for a service,
It deviced the best why it could think of to provide that service, so it's all good now?!

I suspect, but admittedly have not studied this for real, you can create a single function with the GETTIMESTAMP, and call that from those hidden routines. The end result may be better or worse. Dunno

"junk spam",
Why not change that to a real looking name, or even a real name? Or at least have to courtesy to sign of with a seemingly real (first) name?

Cheers,
Hein van den Heuvel
Occasional Visitor
Krister Spandau Junker
Posts: 3
Registered: ‎06-04-2007
Message 6 of 7 (192 Views)

Re: Pascal copiler generated %init function


>>You did without so long, why change now!

We have experienced some application errors during the latest months. The time of the errors could be of some interest when trying to pinpoint the problem :-)

>>Just curious... why does it bother you?

Our software distribution method is quite strange. We compile on a development machine, and link during the installation on the test- and production-machines. If the compiler starts to generate new functions we get link errors when the new modules are being installed and linked together with older modules without the %INIT-functions

>>I suspect, but admittedly have not
>>studied this for real, you can create
>>a single >>function with the
>> GETTIMESTAMP, and call that from
>>those hidden routines. The end
>>result may be better or worse

Thanks, I'll try that!

Regards
Krister
Respected Contributor
John Reagan
Posts: 131
Registered: ‎05-30-2004
Message 7 of 7 (192 Views)

Re: Pascal copiler generated %init function

TIMESTAMPs have a hidden version field for the situation where we might change the layout in the future (unlikely). So timestamps have a hidden initialization.

Depending on where you declared the timestamp in the module, it seems the compiler wanted a LIB$INITIALIZE routine to do that initialization.

I'd have to see more detailed source to give a workaround/solution.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.