Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!tgr!root%bostonu.csnet@csnet-relay.arpa From: root%bostonu.csnet@csnet-relay.arpa (BostonU SysMgr) Newsgroups: net.unix-wizards Subject: PCC, lint bug Message-ID: <1024@brl-tgr.ARPA> Date: Tue, 27-Aug-85 09:47:25 EDT Article-I.D.: brl-tgr.1024 Posted: Tue Aug 27 09:47:25 1985 Date-Received: Wed, 28-Aug-85 10:36:53 EDT Sender: news@brl-tgr.ARPA Lines: 26 The following totally reasonable looking garbage compiles and passes lint -hp without a peep. It printed garbage on my 4.2 VAX, core dumped on my UNIX/PC (SYSV). I realize the difference between a two dimensional array and a pointer to a pointer (or whatever, pluralize), apparently neither C nor lint does. Sorry if this has been covered. ---------- main() { int x[2][2] ; int **xp = x ; int i,j ; for(i=0 ; i < 2 ; i++) for(j=0 ; j<2 ; j++) printf("%d\n",x[i][j] = i+j) ; for(i=0 ; i < 2 ; i++) for(j=0 ; j < 2 ; j++) printf("%d\n",xp[i][j]) ; } ---------- -Barry Shein, Boston University P.S. Found this while trying to speed up a hand translation of Footran->C