[FreeVMS] Null Termination & Optional Arguments


Subject: [FreeVMS] Null Termination & Optional Arguments
From: Andrew Allison (freevms@sympatico.ca)
Date: Sun Dec 28 2003 - 00:29:10 CET


Hello:

    Just to let you know, I using the C style variable arguments in the run
time libraries I'm writing. The parameter may or may NOT be there. I not
assuming that there will be null filled parameter lists. For example I just
finished str$find_first_substring which can have any number of trailing
arguments. i.e there is no finite number specified. I think the NULL place
holder is a requirement determined by the programming language used.

source, index, subindex, substring, [...substring]

( Just don't ask me if that was correct BNF syntax)

Survey time

Language Null filled
------------------------------
DCL Yes / Comma's
Cobol Comma's
C No
Fortran Can't remember
Assembly No

As a foot note I had some bizarre behavior in the operation of va_arg where
null was not passed onto the stack correctly.

Now, to spice things up somewhat with null terminated strings.

I've combine the descriptor / counted string VMS concept with the Null
terminated string concept.
I'm presuming that a little re-writing will be required when FreeVMS
progresses a little further.

A: Since we are writing in C under Linux, strings are null terminated and
I haven't written / or seen a printf scanf routine that handles string
descriptors.

B: I been a little concerned about the use of the linux C string function
calls since they all expect null termination, but I hope when we write the C
compiler these little problems will go away :-)

Andrew

-- 
Liste de diffusion FreeVMS
Pour se désinscrire : mailto:freevms-request@ml.free.fr?subject=unsubscribe



This archive was generated by hypermail 2b25 : Sun Dec 28 2003 - 01:15:28 CET