From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id 03C0D3857C40 for ; Wed, 12 Aug 2020 11:59:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 03C0D3857C40 Received: by mail-il1-x131.google.com with SMTP id z3so1360092ilh.3 for ; Wed, 12 Aug 2020 04:59:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9p5X5hah9g749Cwy7YsjrtUC4do2fw1jn1VlTIu/0PY=; b=e03Uy5xpHP85Kbj93EEE6oXQ8ggCwiExBM9z6wTebCqgB1Fw8SFdphSCt/lEjeF6UR bZtdYJ6NXCyumRfMsevzSqYx8Wll4U9i4x8mxohmN9VKSVUwjwmw7hDpEFKTkWyKzc2W aBRp2OQTDfMbTRsy1H2EO82R1IbdnqNRzPsU/X9W/dpwMIoTNawV7WOjS8u8L0LbPfDJ Z6fpHyZO9+sLLLVNsUy/3iIXN5KElwxxnbejoZfix1FHxYVh2yuoXmGn6miy0BG9BeMB ci9PylSyvoVoMk7ZVVeQmbLb17/dAM243/SPfIRQaNv4koRU1A3g9XoT25ab2LlOtNS1 0bNA== X-Gm-Message-State: AOAM532ky7yAbDwQKpxTnTeiEdsLlZfHjc/Ikc6eAOWAipJllasR7Slt kIgP1mMjFtzsbnZz6DS0QdHXJn84hXh6MEKIzKM= X-Google-Smtp-Source: ABdhPJyWrtMbVR4QIUDlm6H+Rk7e0JV22OkHSEA0ElRzNAkqshI6k9IUQ0Wb3w2/IF9Hqst0FnVtniKRLuYNdDNSyB4= X-Received: by 2002:a92:d7ca:: with SMTP id g10mr7469386ilq.30.1597233569538; Wed, 12 Aug 2020 04:59:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 12 Aug 2020 12:59:18 +0100 Message-ID: Subject: Re: Is realloc(3) permitted to fail when shrinking a block? To: =?UTF-8?B?5a2Z5LiW6b6ZIHN1bnNoaWxvbmc=?= Cc: Dan Kegel , gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2020 11:59:31 -0000 On Wed, 12 Aug 2020 at 12:23, =E5=AD=99=E4=B8=96=E9=BE=99 sunshilong wrote: > > >This mailing list is about GCC, not general C programming. The realloc > >function is not part of GCC. > Sorry, I didn't notice it. > I took it granted that libc is part of the GCC since there is a folder > named "libstdc++" in the Github of GCC(i.e. > https://github.com/gcc-mirror/gcc/tree/master/libstdc%2B%2B-v3). > > One more question arises, why there is no library for libc whereas > libstdc++ is provided by GCC? Because every unix-like OS already has its own libc, because C and UNIX were developed hand-in-hand. Traditionally they didn't have a C++ library, so a C++ compiler has to provide the C++ library.