From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,646a19dc9b983c25,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-07-23 11:53:47 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!darwin.sura.net!news-feed-1.peachnet.edu!concert!balsam!benites From: benites@cs.unca.edu (Robert Benites) Newsgroups: comp.sys.dec Subject: Alpha Xlib Problem Date: 23 Jul 1993 18:35:39 GMT Organization: University of North Carolina at Asheville Distribution: world Message-ID: <22pb1r$fbo@balsam.unca.edu> NNTP-Posting-Host: sylva.cs.unca.edu I have a program that runs fine on Ultrix 4.3 but when I compile and run the same program on OSF/1 on an alpha it blows. The following excerpt from the program is simply trying to take an X parameter name and value from the command line and print it. I have determined that there is some kind of alignment problem with the "database" argument to one of the Xrm* (ParseCommand, GetResource) calls. If an int variable (chgcount below) is defined before the commandlineDB variable the program will bomb. When I run lint on the source using the -Q option I get the following warnings: "llib-lc.c", line 452: warning: function memccpy type inconsistent "llib-lc.c", line 453: warning: function memchr type inconsistent These bring to mind comments made by tsnee@gibbs.oit.unc.edu regarding problems with dbm and gdbm in a recent post. Anyone have any ideas about what to do or how to proceed from here? Thanks! Bob Benites benites@cs.unca.edu #include #include #include #include #include static XrmOptionDescRec opTable[] = { { "-font", "*font", XrmoptionSepArg, (XPointer) "default?"}, { "-display", ".display", XrmoptionSepArg, (XPointer) NULL} } ; void main(int argc, char **argv) { #ifdef BOMB int chgcount; #endif XrmDatabase commandlineDB ; XrmValue value; char resource_name[100] ; char *str_type[20]; resource_name[0] = '\0' ; printf("doing XrmInitialize\n"); XrmInitialize() ; printf("doing XrmParseCommand\n"); XrmParseCommand(&commandlineDB, opTable, 2, argv[0], &argc, argv) ; printf("XrmGetResource (display) from cmdline\n"); if (XrmGetResource(commandlineDB, "mandel.display", "Mandel.Display", str_type, &value) == True) (void) strncpy(resource_name, value.addr, (int) value.size) ; printf("%s\n",resource_name); }