[Courses] Reminder, and questions (and semi spoiler on ex 6-1)

Laurel Fan laurel at sdf.lonestar.org
Wed Feb 27 18:49:48 EST 2002


On Mon, Feb 25, 2002 at 02:36:55PM -0500, Michelle Murrain wrote:
> After doing some experimentation, it seems that it segfaults when it is 
> trying to put a value in the variable y1. Is y1 reserved? When I try to 
> initialize y1 by saying:
> int y1 = 0;
> 
> I get this error:/usr/bin/ld: Warning: type of symbol `y1' changed from 2 
> to 1 in /home/mpm/tmp/cc4lBMzm.o
> 
> When, instead of asking for y1 I just assign it's value:
> 
> y1 = 23;
> 
> It segfaults.
> 
> And, the clincher - replace the variable name y1 with yy1, and it all works 
> just fine, thank you. So is y1 a reserved word??? What am I missing?

To me this looks like y1 is already defined (not reserved, which means
reserved by the language itself, like 'int' and 'for'), but defined by
code.  Because you have obviously not already defined it, it must be
defined by an external library.  You'd probably get the same sort of
symptoms if you tried to do "printf = 23".  y1 does appear to be a
function in the math library; the manpage for y1 on my machine talks
about "Bessel functions" and mentions math.h.

-- 
laurel at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



More information about the Courses mailing list