| Author |
Message |
David B Sneddon - bigpond *nix forums addict
Joined: 21 Jul 2005
Posts: 68
|
Posted: Wed Feb 02, 2005 11:25 pm Post subject:
%DCL-W-OKTAB again...
|
|
|
Christoph,
The following program also generates the %DCL-W-OKTAB status
when it is in fact trying to exit with SS$_NORMAL...
$ create oktab.bas
program oktab
option type = explicit, &
constant type = integer, &
size = (integer long, real double)
external long function sys$exit
declare long constant array_size = 261440/16
declare long condition_value
declare long magic
map (rubbish) long dummy_array (1 to array_size)
condition_value = 1 ! ss$_normal
magic = array_size - 131
dummy_array (magic) = condition_value
call sys$exit (dummy_array(magic)) !***
end program
$ basic oktab
$ link oktab
$ run oktab
%DCL-W-OKTAB, command tables are already in latest format
The argument to sys$exit is passed by the wrong mechanism.
Regards,
Dave
--
David B Sneddon (dbs) VMS Systems Programmer dbsneddon@bigpond.com
Sneddo's quick guide ... http://www.users.bigpond.com/dbsneddon/
DBS freeware http://www.users.bigpond.com/dbsneddon/software.htm |
|
| Back to top |
|
 |
Dave Froble *nix forums Guru
Joined: 21 Jul 2005
Posts: 1172
|
Posted: Thu Feb 03, 2005 8:13 am Post subject:
Re: %DCL-W-OKTAB again...
|
|
|
David B Sneddon - bigpond wrote:
| Quote: | Christoph,
The following program also generates the %DCL-W-OKTAB status
when it is in fact trying to exit with SS$_NORMAL...
$ create oktab.bas
program oktab
option type = explicit, &
constant type = integer, &
size = (integer long, real double)
external long function sys$exit
declare long constant array_size = 261440/16
declare long condition_value
declare long magic
map (rubbish) long dummy_array (1 to array_size)
condition_value = 1 ! ss$_normal
magic = array_size - 131
dummy_array (magic) = condition_value
call sys$exit (dummy_array(magic)) !***
end program
$ basic oktab
$ link oktab
$ run oktab
%DCL-W-OKTAB, command tables are already in latest format
The argument to sys$exit is passed by the wrong mechanism.
Regards,
Dave
|
Yep! Good example. From HELP:
SYSTEM_SERVICES
$EXIT
Argument
code
OpenVMS usage:cond_value
type: longword (unsigned)
access: read only
mechanism: by value
Longword value to be saved in the process header as the
completion status of the current image. If you do not specify
this argument in a macro call, a value of 1 is passed as the
completion code for VAX MACRO and VAX BLISS-32, and a value of
0 is passed for other languages.
The change to the example above to preclude such mistakes is:
external long function sys$exit( LONG by value )
But 'REAL' programmers don't need such compiler help, or do they? :-)
Dave |
|
| Back to top |
|
 |
David B Sneddon - bigpond *nix forums addict
Joined: 21 Jul 2005
Posts: 68
|
Posted: Thu Feb 03, 2005 9:16 am Post subject:
Re: %DCL-W-OKTAB again...
|
|
|
Dave Froble was overheard to say:
| Quote: |
The change to the example above to preclude such mistakes is:
external long function sys$exit( LONG by value )
But 'REAL' programmers don't need such compiler help, or do they? :-)
Dave
|
But then surely 'REAL' programmers KNOW all the system services,
all the relevant parameters and their passing mechanisms... ;-)
Regards,
Dave.
--
David B Sneddon (dbs) VMS Systems Programmer dbsneddon@bigpond.com
Sneddo's quick guide ... http://www.users.bigpond.com/dbsneddon/
DBS freeware http://www.users.bigpond.com/dbsneddon/software.htm |
|
| Back to top |
|
 |
David Jones *nix forums beginner
Joined: 03 Feb 2005
Posts: 17
|
Posted: Thu Feb 03, 2005 9:40 am Post subject:
Re: %DCL-W-OKTAB again...
|
|
|
In message <42016F96.4070807@bigpond.com>,
David B Sneddon - bigpond <dbsneddon@bigpond.com> writes:
| Quote: | The following program also generates the %DCL-W-OKTAB status
when it is in fact trying to exit with SS$_NORMAL...
|
Iteresting, but the program in question is written in C and exits by way
of its main() function returning a value of -32592. Some sort of strange
interaction between DCL and the pthread exit handler seems to be going on.
David L. Jones | Phone: (614) 292-6929
Ohio State University | Internet:
140 W. 19th St. Rm. 231a | jonesd@er6s1.eng.ohio-state.edu
Columbus, OH 43210 | vman+@osu.edu
Disclaimer: I'm looking for marbles all day long. |
|
| Back to top |
|
 |
Dave Froble *nix forums Guru
Joined: 21 Jul 2005
Posts: 1172
|
Posted: Thu Feb 03, 2005 4:32 pm Post subject:
Re: %DCL-W-OKTAB again...
|
|
|
David B Sneddon wrote:
| Quote: | Dave Froble was overheard to say:
The change to the example above to preclude such mistakes is:
external long function sys$exit( LONG by value )
But 'REAL' programmers don't need such compiler help, or do they? :-)
Dave
But then surely 'REAL' programmers KNOW all the system services,
all the relevant parameters and their passing mechanisms...
|
'Real' programmers get old and forgetful. That include file with all the often
used external declarations has many saves.  |
|
| Back to top |
|
 |
Larry Kilgallen *nix forums Guru
Joined: 05 Mar 2005
Posts: 729
|
Posted: Thu Feb 03, 2005 11:34 pm Post subject:
Re: %DCL-W-OKTAB again...
|
|
|
In article <4201FA0E.7040706@bigpond.com>, David B Sneddon <dbsneddon@bigpond.com> writes:
| Quote: | Dave Froble was overheard to say:
The change to the example above to preclude such mistakes is:
external long function sys$exit( LONG by value )
But 'REAL' programmers don't need such compiler help, or do they? :-)
Dave
But then surely 'REAL' programmers KNOW all the system services,
all the relevant parameters and their passing mechanisms...
|
Real programmers use languages for which system services and their
calling conventions are predefined. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|