Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun-barr!ames!dftsrv!nssdcs!setzer From: setzer@nssdcs (William Setzer (IDM)) Newsgroups: comp.windows.x Subject: Is the resource manager weird, or is it just me? Message-ID: <320@dftsrv.gsfc.nasa.gov> Date: 15 Jun 89 23:29:08 GMT Sender: news@dftsrv.gsfc.nasa.gov Reply-To: setzer@nssdcs (William Setzer (IDM)) Distribution: usa Organization: NSSDC Greenbelt Md. Lines: 21 I have just finished debugging the resource manager portion of my (first real) X Window application. The bug that caused me grief was the following: The database that I passed to XrmParseCommand was declared inside of a function (ie. it was type auto). As I discovered, it didn't contain NULL. Thus when XrmGetResource was called, it tried to find quarks in all of the garbage that my variable happened to point to (can anyone say 'bus error'?). The problem is, XrmDatabase is an opaque data type. Thus, I _can't_ initialize it (to NULL). Therefore, I have to declare the variable globally, and thus take advantage of C's implicit zeroing out of the data. Now to the questions: (1) Can the rm be used (safely) with only local variables? (2) Is there a way to initialize XrmDatabase variables to NULL (legally)? (3) Did I just miss something? (4) Is it a 'bug', a 'feature', or neither? Any help would be appreciated. This 'bug' just burns me up. -- William Setzer nssdcs.gsfc.nasa.gov