octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question


From: Chuck Robey
Subject: Re: Question
Date: Tue, 19 May 1998 13:34:37 -0400 (EDT)

On Tue, 19 May 1998, John W. Eaton wrote:

> On 19-May-1998, Chuck Robey <address@hidden> wrote:
> 
> | I've not dropped this.  I just found that if I add the qualifier
> | "string" to the variables like in line 198 above (and several after) it
> | no longer gets the SIGBUS.  I still am getting a SIGBUS at line 211,
> | which I modified:
> | 
> |     210   char *hd = getenv ("HOME");
> |     211   string Vhome_directory = hd ? hd : "I have no home!";
> 
> By doing that, you are creating a local variable called
> Vhome_directory that shadows the global one.  That's definitely not
> what should happen.
> 
> Try changing it to
> 
>   Vhome_directory = hd ? string (hd) : string ("I have no home!");
> 
> If that fails to compile, do it like this instead:
> 
>   if (hd)
>     Vhome_directory = string (hd);
>   else
>     Vhome_directory = string ("I have no home!");
> 
> There may be other places where you need to make similar changes.  Can
> you please let me know where, so I can change my sources?
> 
> I think this problem is probably a bug in the compiler you are using,
> but I'm willing to modify the Octave sources to work around the bug.

What about what I did to line 198, is that also hiding a global?  I
noticed it's also referred to in toplev.cc, so I tried to change line
198 back to what it was, and add an extern declaration at the top, but
it still got the SIGBUS.  Only adding the "string" at 211 got past the
SIGBUS ok.  BTW, I'm testing your suggested mod on line 211 now.

> 
> Thanks,
> 
> jwe
> 
> 

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
address@hidden         | communications topic, C programming, and Unix.
213 Lakeside Drive Apt T-1  |
Greenbelt, MD 20770         | I run Journey2 and picnic (FreeBSD-current)
(301) 220-2114              | and jaunt (NetBSD).
----------------------------+-----------------------------------------------






reply via email to

[Prev in Thread] Current Thread [Next in Thread]