Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [Bug] Exiting shell from function called by trap handler always produces status 0



On Tue, 2018-10-09 at 14:43 +0100, Peter Stephenson wrote:
> On Tue, 2018-10-09 at 13:39 +0000, Daniel Shahaf wrote:
> > Peter Stephenson wrote on Tue, 09 Oct 2018 14:16 +0100:
> > A function-local 'static' (below) is implicitly initialized to 0, but
> > a non-static global is not implicitly initialized.
> If that's really the case then the entire shell (look around at other
> cases), and pretty much every other non-trivial programme I've ever
> written, is fundamentally broken.  I'm not going to try to fix that now.
> 
> I can't quote chapter and verse but in all interesting cases they're
> initialised to zero.

Looking around at some discussions of this subject on websites...

I wonder if you're getting confused between static and automatic
*allocation* vs. global and static *linkage*?  Linkage has no effect
here: global variables are statically allocated.

pws



Messages sorted by: Reverse Date, Date, Thread, Author