niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Not Unix » VMS
%DCL-W-OKTAB again...
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
David B Sneddon - bigpond
*nix forums addict


Joined: 21 Jul 2005
Posts: 68

PostPosted: Wed Feb 02, 2005 11:25 pm    Post subject: %DCL-W-OKTAB again... Reply with 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
--
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

PostPosted: Thu Feb 03, 2005 8:13 am    Post subject: Re: %DCL-W-OKTAB again... Reply with quote

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

PostPosted: Thu Feb 03, 2005 9:16 am    Post subject: Re: %DCL-W-OKTAB again... Reply with quote

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

PostPosted: Thu Feb 03, 2005 9:40 am    Post subject: Re: %DCL-W-OKTAB again... Reply with quote

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

PostPosted: Thu Feb 03, 2005 4:32 pm    Post subject: Re: %DCL-W-OKTAB again... Reply with quote

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... Wink


'Real' programmers get old and forgetful. That include file with all the often
used external declarations has many saves. Smile
Back to top
Larry Kilgallen
*nix forums Guru


Joined: 05 Mar 2005
Posts: 729

PostPosted: Thu Feb 03, 2005 11:34 pm    Post subject: Re: %DCL-W-OKTAB again... Reply with quote

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... Wink

Real programmers use languages for which system services and their
calling conventions are predefined.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 4:39 am | All times are GMT
navigation Forum index » Not Unix » VMS
Jump to:  


Mortgages | Libros arquitectura | Problem Mortgage | MPAA | Credit Cards UK
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2254s ][ Queries: 11 (0.0630s) ][ GZIP on - Debug on ]