From owner-freebsd-current Tue Jun 2 18:17:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA22312 for freebsd-current-outgoing; Tue, 2 Jun 1998 18:17:33 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (root@smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA22290 for ; Tue, 2 Jun 1998 18:17:27 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id QAA09013; Tue, 2 Jun 1998 16:10:02 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp02.primenet.com, id smtpd008861; Tue Jun 2 16:09:35 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id QAA23355; Tue, 2 Jun 1998 16:09:27 -0700 (MST) From: Terry Lambert Message-Id: <199806022309.QAA23355@usr01.primenet.com> Subject: Re: ppp cannot find libalias To: mike@smith.net.au (Mike Smith) Date: Tue, 2 Jun 1998 23:09:27 +0000 (GMT) Cc: hetzels@westbend.net, mike@smith.net.au, current@FreeBSD.ORG In-Reply-To: <199806021711.KAA01018@antipodes.cdrom.com> from "Mike Smith" at Jun 2, 98 10:11:01 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > >Not even the hint cache. Note that this is the a.out rtld; I don't > > >know (yet) where to look for the ELF one. > > > > Mike, I cleaned up your code, I HATE goto's. > > Terry likes them. I find them easier to deal with than insane nesting. I don't like them or not like them; I think it's silly to use bizarre constructs to avoid indentation, ie: for(;;) { if( aaa) break; if( bbb) break; if( ccc) break; if( ddd) break; if( eee) break; break; } You might as well use "?:" constructs. 8-|. What I like is single-entry/single-exit, and if it occasionally takes a goto to make this work, I prefer a goto (which has a specific, named target that I can search for) to a break (which may dump me out after any particular closing brace, and I have to go searching to find out which one). People who hate goto's for the sake of hating goto's don't understand that no matter how hard they try, the compiler is going to generate branch and jump instructions, and there's nothing they can do about it in a high level language, except cause the optimizer to invoke loop register preload and unrolling optimizations erroneously. A goto is a perfectly valid way to handle an exceptional condition; if you see you are skipping a lot of code with one, you have probably failed to correctly perform the necessary functional decomposition on your code; shame on you. There are numerous examples of this in the FreeBSD kernel, unfortunately. If you see yourself using a lot of goto's, well, it's either beta code that you've written that way for program flow readability (don't expect or suggest that it should be checked in), or you're optimizing for something other than the most common case and you are probably writing code that's a lot slower than it ought to be. For non-beta code, where it's now known to work, converting goto's to negative logic is a win (it saves branch instructions). > Are there any disagreements with the basic idea, ie. use rtfindfile() > to locate files requested by dlopen() if they do not contain path > components? I think it's fine. That's why I didn't bitch the first time it went by... 8-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message