Path: utzoo!utgpu!water!watmath!clyde!ima!marc From: marc@ima.ISC.COM (Marc Evans) Newsgroups: comp.lang.c Subject: C/dbx problem under Ultrix 2.0 Keywords: C, dbx, Ultrix Message-ID: <881@ima.ISC.COM> Date: 11 Feb 88 14:21:16 GMT Reply-To: marc@symetrx.UUCP Organization: Symmetrix, Ipswich, MA Lines: 25 While hacking with some source the other day, I discovered some strangeness in dbx given a couple different variations of the following program: main() { static struct foo_t { char *a,*b; } foo[] = { "foo", "bar", "hello", "world", "what's", "up", }; printf("%s %s\n",foo[1].a,foo[2].b); } This program compiles and runs fine on my Ultrix 2.0 system using /bin/cc. The problem that exists is when using dbx. Try usign dbx and stoping at the printf line, then do a 'print foo'. On my system, I get a dump of a bunch of octal (-1)'s. A subtle change of moving the structure outside of the function to the module level, produces the same results. The interresting part is that if after moving the structure to the module level, then removing the 'static' from the declaration, dbx does the *proper* thing when requesting 'print foo'. Is this normal for dbx, or is it just an Ultrix problem.