Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!think!ames!amdcad!sun!imagen!auspyr!john From: john@auspyr.UUCP (John Weald) Newsgroups: comp.os.vms Subject: re: where is C$MEMFUNC Message-ID: <9051@auspyr.UUCP> Date: Fri, 11-Sep-87 12:44:46 EDT Article-I.D.: auspyr.9051 Posted: Fri Sep 11 12:44:46 1987 Date-Received: Sun, 13-Sep-87 02:22:09 EDT Reply-To: john@auspyr.UUCP (John Weald) Organization: Austec, Inc. San Jose Lines: 67 On the subject of the memxxx functions here is a bug. We are running on one of those strange combinations mentioned in earlier articles. We have VMS 4.5 with a C 2.3 compiler and RTL on a uVAX. It would appear that memset() does not save/restore the registers. Here is a sample program: ++++++++++++++++++Cut here+++++++++++++++++++++++++++++++++++++++ main(argc, argv) int argc; char *argv[]; { char b[100]; int r1; /* These guys will be in registers */ int r2; int r3; /* This guy is in R6 */ int r4; int r5; int r6; /* assign them something that the compiler */ /* will not be clever with */ r1 = atoi(argv[1]); r2 = atoi(argv[2]); r3 = atoi(argv[3]); r4 = atoi(argv[4]); r5 = atoi(argv[5]); r6 = atoi(argv[6]); f(r1, r2, r3, r4, r5, r6); memset(b, 0, sizeof(b)); f(r1, r2, r3, r4, r5, r6); } f(a1, a2, a3, a4, a5, a6) int a1, a2, a3, a4, a5, a6; { printf("%d %d %d %d %d %d\n", a1, a2, a3, a4, a5, a6); } Compile it in the usual manner. Install the command with the usual: proggie = "$ dev:[path]proggie.exe" and run it as: proggie 1 2 3 4 5 6 the output is: 1 2 3 4 5 6 1 2 0 4 5 6 Using the debugger it is R6 that gets corrupted. Cheers! John Weald Austec Inc. San Jose -- UUCP: {styx,imagen,dlb,gould,sci,altnet}!auspyr!john