Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!hplabs!pyramid!pyramid.com!bjb From: bjb@pyramid.com (Bruce Beare) Newsgroups: comp.sys.mac.programmer Subject: Linking Problem with ThinkC Message-ID: <158533@pyramid.pyramid.com> Date: 7 Jun 91 16:59:38 GMT Sender: news@pyramid.pyramid.com Distribution: na Organization: Pyramid Technology Lines: 33 I just noticed the following behaviour with ThinkC.... file1.... --------- #include "structures.h" Defaults gdefaults = {1,2,3}; file2.... ---------- #include "structures.h" Defaults *gdefaults; void whatever(void) { somewhere = gdefaults->anything; } ___________________________________________ I was tracking down an elusive bug where 'somewhere' wouldn't get properly initialized. When I put a breakpoint at the assignment line and then used the data window to look at gdefaults, the data window told me that gdefaults was a zero-valued pointer (a dead giveaway). Sure -- this IS a typical stupid programming bug, but I would have expected the linker to give me some warning. -Bruce bjb@pyramid.com