From owner-freebsd-hackers Mon May 12 03:01:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA09061 for hackers-outgoing; Mon, 12 May 1997 03:01:48 -0700 (PDT) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA09053 for ; Mon, 12 May 1997 03:01:40 -0700 (PDT) Received: from labs.usn.blaze.net.au (local [127.0.0.1]) by labs.usn.blaze.net.au (8.8.5/8.8.5) with ESMTP id UAA16897 for ; Mon, 12 May 1997 20:01:29 +1000 (EST) Message-Id: <199705121001.UAA16897@labs.usn.blaze.net.au> To: freebsd-hackers@freebsd.org Subject: Re: g++ shared library segfaults In-reply-to: Your message of "Sat, 10 May 1997 08:31:42 +0200." <19970510083142.OD64404@uriah.heep.sax.de> X-Face: (W@z~5kg?"+5?!2kHP)+l369.~a@oTl^8l87|/s8"EH?Uk~P#N+Ec~Z&@;'LL!;3?y Date: Mon, 12 May 1997 20:01:29 +1000 From: David Nugent Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk J"org writes: > As Justin T. Gibbs wrote: > > > * As described above, the scope of variables declared in the > > initialization part of a for statement has been changed; such > > variables are now visible only in the loop body. Use > > `-fno-for-scope' to get the old behavior. You'll need this flag > > to build groff version 1.09, Ptolemy, and many other free software > > packages. > > Du-oh. While i always considered it poor style to declare a variable > inside a for statement, when it was intended to use it later on, i > think that's a fairly drastic change in the semantics. Indeed it is and was. It broke many things at the time. I still have to fix the occasional program by moving the declaration outside of the for() statement. This was part of a wider set of changes relating to scope and the semantics of declarations, but this is the only area which actually caused working code to break. Doing it was necessary for reasons of consistency since they wanted to support if ((int x = blah) ... and so on, otherwise it would have become a language wart (or ANOTHER language wart, where C++ is concerned :-)). The change did actually simplify the rules from the point of view of parsing c++ code. Regards, David David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/