Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!oberon!cit-vax!ucla-cs!zen!ucbvax!psw.DEC.COM!winalski From: winalski@psw.DEC.COM (Paul S. Winalski) Newsgroups: comp.os.vms Subject: using UIS routines with C Message-ID: <8709100059.AA06296@decwrl.dec.com> Date: Wed, 9-Sep-87 23:54:00 EDT Article-I.D.: decwrl.8709100059.AA06296 Posted: Wed Sep 9 23:54:00 1987 Date-Received: Sat, 12-Sep-87 04:48:38 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 32 The problem with your call to UIS$CREATE_DISPLAY is with the use of floating constants in the routine argument list. VAX C floating point constants are of type double, not type float (see GUIDE TO VAX C, section 6.4.1, Floating- Point Constants). Furthermore, C passes arguments by value, whereas the arguments to UIS$CREATE_DISPLAY are all by reference. The ACCVIO occurs because you are passing in D-float values and UIS$CREATE_DISPLAY is trying to use them as the addresses of F-float values. Something similar to the following ought to work: #include #include #include main() { long int vd_id; float one = 1.0; float ten = 10.0; float twenty = 20.0; vd_id = uis$create_display(&one, &one, &twenty, &twenty, &ten, &ten); printf("created virtual display\n"); } Unfortunately, UISENTRY.H doesn't use function prototypes, which would have caught this error at compile time. I don't think function prototypes were implemented in VAX C at the time that UISENTRY.H was written. --PSW