From: benites@cs.unca.edu (Robert Benites)
Subject: Alpha Xlib Problem
Date: 23 Jul 1993 18:35:39 GMT [thread overview]
Message-ID: <22pb1r$fbo@balsam.unca.edu> (raw)
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 <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include <stdio.h>
#include <strings.h>
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);
}
reply other threads:[~1993-07-23 18:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox