Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ut-sally!pyramid!pesnta!valid!pete From: pete@valid.UUCP (Pete Zakel) Newsgroups: net.lang.c,net.micro.pc,net.unix Subject: Re: C'mon, guys! Message-ID: <404@valid.UUCP> Date: Wed, 2-Jul-86 23:38:13 EDT Article-I.D.: valid.404 Posted: Wed Jul 2 23:38:13 1986 Date-Received: Fri, 4-Jul-86 01:27:43 EDT References: <811@bu-cs.UUCP> <835@osiris.UUCP> Organization: Valid Logic, San Jose, CA Lines: 36 Xref: watmath net.lang.c:9709 net.micro.pc:8968 net.unix:8498 > I'm sure that this is the problem with with many programmers, but not > all. I just ran into a situation yesterday here at the Hospital where > one of our programmers was falsely attributing a bug to the C compiler > because the following declaration caused the program to die of a > segmentation violation: > > static char **ptrarray = { > "", > "str1", > "str2", > "etc." > }; > > The programmer found that the alternate declaration > > static char *ptrarray[] = { > "", > "etc." > }; > > ran just fine. > > (Of course there really *is* a bug in the compiler, since it let the > original declaration through without even a peep; it's just not the bug > imagined by the programmer. For everyone's info, the compiler is cc on > OSx v3.1 [Pyramid Computer Corp.] and I have suggested that the company > be notified of this bug. In the meantime, can anyone tell me whether > this is a known pcc bug, or is it specific to Pyramid's cc?) > > Phil Kos ...!decvax!decuac Our pcc based compiler said "warning: illegal pointer combination, op =" and "compiler error: initialization alignment error" to the first declaration. -- -Pete Zakel (..!{hplabs,amd,pyramid,ihnp4}!pesnta!valid!pete)