From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11428 invoked by alias); 24 May 2012 18:05:45 -0000 Received: (qmail 11404 invoked by uid 22791); 24 May 2012 18:05:43 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 18:05:20 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4OI51CE027380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 May 2012 14:05:02 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4OI4x6n010486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 14:05:00 -0400 From: Tom Tromey To: "Maciej W. Rozycki" Cc: Joel Brobecker , Mark Kettenis , , , Subject: Re: [SH] regs command References: <87r4ukox0y.fsf@fleche.redhat.com> <20120516190539.GZ10253@adacore.com> <201205171109.q4HB9Ljc005742@glazunov.sibelius.xs4all.nl> <20120517123827.GB10253@adacore.com> <201205171522.q4HFMWGM026439@glazunov.sibelius.xs4all.nl> <20120517154502.GE10253@adacore.com> <87zk96k2my.fsf@fleche.redhat.com> <20120517203757.GG10253@adacore.com> <871umhk3f6.fsf@fleche.redhat.com> Date: Thu, 24 May 2012 18:05:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Tue, 22 May 2012 00:36:13 +0100") Message-ID: <87k4018ng4.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00943.txt.bz2 >>>>> "Maciej" == Maciej W Rozycki writes: Maciej> Hmm, I gave it some thinking and it looks to me like a Maciej> functional programming problem to solve (e.g. AC_REQUIRE in Maciej> autoconf-speak; I didn't really do any functional programming Maciej> beyond that). :) Maciej> This may not be possible to express in C in a very elegant way, Maciej> but I can imagine retaining the current init.c Maciej> arrangement/scriptery, but in addition to that letting Maciej> initialisers call one another. Another way would be to just directly express it, say in comments that are extracted by the script used to create init.c. /* Requires: something_else */ void _initialize_something (void) { ... } Then dependency loops could be caught at init.c-generation time. The problem with anything like this is maintenance of the dependencies. That is, how do you know if one is stale? Or what do you do if you actually hit a cycle? For example, in the case in question -- when we eventually remove the "regs" command, would we remember to delete the "Requires"? Tom