From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id BD4433857C40 for ; Thu, 7 Dec 2023 15:42:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD4433857C40 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD4433857C40 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701963779; cv=none; b=Mc2r6MvPBhQbV9IaEvffNiJQHyXFruCuYywxvRP4pS3MWA3HR0rFPdxWnVH3iRDljzSnTndq0XYZbHHgWyHrSkfBPqL2Manr0Mh/XaTYA1SMd5Pfng/X5Blbtm5yYlsFD6QhCXnJgmX0TNok08QDPkDZBcojpbJbrCHTV2vIsRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701963779; c=relaxed/simple; bh=s/Yw7h4eRkvi1i1osa/XdeI431+yK8kFEENhPH3MJtI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=OGUqdy87MkUUwawWS3EPmf8GBFqGazWME/5vzPDbvVHqQGmJYAFRKfmfrC9WAXPCO7LOCktImaf17HWPc+2xRYjqW/RfzY6VSzTxDvNYmW+enCCR6lLUXgy5vGhs2+qkzQ7CsVDVtC6DEQSD/9c466zeFcg2HpeUW7Hmd7qAziA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c236624edso11586995e9.1 for ; Thu, 07 Dec 2023 07:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1701963776; x=1702568576; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UobgopSSC4hR+g+gYYqPRIlXkRnpfG5InUXJ0F7av5I=; b=gjqUcMfy8N2DL8YMkTUr0DZ9aST2kHG4bXEbdesBU8rhSwL6xF4Bzwc+vhZTXkP9fk l+LryesBRrJ4hDVbsdDTxCiw8F5uEYURmqpLm6pgy7Z2QVUsUjkhm3KPVRd5G4W+R/Cc 2Dgof6dOmjjaNSN3DptnZghlfgyH8PRJXuzR8JPbIw1M9xIMVA/egx01l7SnGdtEIUrM gZ9rpZ6pY65iLLmqatBO7HwuyWaen6OZZm/XAeOHSbU7+4t679yfRjuF4AkRhXm0ew/o WSbpdJcZwjOk7lXnGXLTcNT1byXmoI6YOpBgl8vZ0lVNUor1k1UV1D7DF+FPMHQOteC0 X/NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701963776; x=1702568576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UobgopSSC4hR+g+gYYqPRIlXkRnpfG5InUXJ0F7av5I=; b=SRe0O1Cb5GG7RkWY4pnAmn/EzVhj8dwKsAJJq20rJdtB4cWVlqAt5bCHV0LNdNkiTL wKU9I5+YGwHJw8spTEjSAgvoBq8WG/NHXhcWNHc79hAHaHB/5Hs6QobA9t4PjPCac8CL +HQzQmkH0AnrfZ1kP+wRKXVYSI0Y9G46o5vMmYlVsgGpzq3zf7k/DXjtHJ1EErovofcF QbK8oK7lLhegYa3JsXTBbIMYmYbQicW9AiheJ0qDWsy55Bo6qBDXt+nnt/mqo8uPEoVm Kl34EOM8oALk6rf7gcaEvNtEFZQvT//7A3IAd7vs7w9ufs2TX1ECbp8cWi3RCYdnKq5b nl7g== X-Gm-Message-State: AOJu0YxF9szoVQZ9TiWyLSt0oGsVt1p5Q7N/6uhez/6RhtQs5yEDM12U 6+RBkIDbnq4JB7Ro6ekKUSXxeA== X-Google-Smtp-Source: AGHT+IFyF5CHnbK87xMwS6JQkQcJRmYbhJnRRakFVBC2W01gIzUjFpVD4jQ3Ql7pmIY0sBZj4jbGVQ== X-Received: by 2002:a05:600c:2943:b0:40c:286e:d30e with SMTP id n3-20020a05600c294300b0040c286ed30emr842858wmd.160.1701963776346; Thu, 07 Dec 2023 07:42:56 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id b11-20020a5d4b8b000000b00333381c6e12sm1725409wrt.40.2023.12.07.07.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:42:56 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Siddhesh Poyarekar Cc: Jakub Jelinek , gcc-patches@gcc.gnu.org, Martin Uecker , Andreas Schwab , polacek@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: [gcc15] nested functions in C Date: Thu, 07 Dec 2023 16:42:55 +0100 Message-ID: <4530089.LvFx2qVVIh@fomalhaut> In-Reply-To: <5873bf9b-51f6-4db8-a182-86808fa3bb86@gotplt.org> References: <5873bf9b-51f6-4db8-a182-86808fa3bb86@gotplt.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > I think from a language standpoint, the general idea that nested > functions are just any functions inside functions (which is how the C > nested functions essentially behave) is too broad and they should be > restricted to minimal implementations that, e.g. don't have side-effects > or if they do, there's explicit syntactic sugar to make it clearer. That sounds totally arbitrary though. Algol-derived languages have had nested subprograms for ages, e.g. Pascal or Ada, and they can be very useful. -- Eric Botcazou