From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) by sourceware.org (Postfix) with ESMTPS id 551793857C4F; Mon, 18 Dec 2023 03:44:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 551793857C4F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 551793857C4F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702871098; cv=none; b=FAfsl+gnuAPjqcV4DV0lnY6wIUS+13wfd1LLn8rAlsMPc+O496ucjHgchgMnsG4sIhxYQ6BvsYBdxCSBlv+XCmnjNHlUGl18mbCpdxzi/7l8bf+QFHlq+0ANeJO1QLkmMjrFzwj09SEnDLLKW3hOX48JJKpeN9kI1CXavU7SlYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702871098; c=relaxed/simple; bh=eyUME1gSALh9oKzk3yb5bgZrf1NonWWQlzsTWcl2WjI=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=CNVjpDVJbPp3eQ/Kxn5ZdBGh1hj+6Prus51tFDHzfvED2HRETafxkQ2+tBx58tkbIIpzc1MnsU924cdgbwQMotib4ZbHOWT4zM22knGu4iKFoiznO8WihZ1xLzytFLd1hpR3qUM9atU4yujiaTCOuxAhCRgphPFsc5hqqM0CISk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-1f5bd86ceb3so2011773fac.2; Sun, 17 Dec 2023 19:44:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702871096; x=1703475896; 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=SoONzDYY10qxtxbSNNrgdXJL5hd1Fw5SVgHN0Ww2j1I=; b=wlOnFjJFQlZL/lM5fiPoAcHgNZ5CPmketbqh3GOcq9F6wpYpiVPLfBsyyj+FX010A7 KXjo234V7lfzB/Qk3zqGOYKr57VDin5cVR3hbi7agIw19syNNMkDoUHXt8pQTaX9Bg02 zEcrQIJT3m5xdvRuQP/XFwV0J1dxyC6Qxly+tJqfEQ1F27cImuTGTKt+9NA9zBRACR6C H5DDG95RF8/O0SP8fSJMb0UHnLZMR5RhsBGrKj/obM0/GucHM11BRSkmxAG3IDm87sel Ymv3PN2M9QzuMYsoC7IwNZ/b+hmXeZDDMxN6O82Vldvl3QCkXe7VpewoyOjpEpEueV3K fv7Q== X-Gm-Message-State: AOJu0Yzv27XTPxV3HZvvXs0YJX1dDfn/zur4P93fjZHamG2oq5IRdXIy f0d+VFk31krBh5S8ABV1KWz2Tn4fgxnaCeax X-Google-Smtp-Source: AGHT+IFqmvAywbCrhhICglfTHZlUHDFoQlomZUSz37WaPA2X60JIK/wF0Wu8xvxpPM21FQdIDZwC8w== X-Received: by 2002:a05:6358:724e:b0:16e:2898:5de4 with SMTP id i14-20020a056358724e00b0016e28985de4mr18511759rwa.6.1702871096125; Sun, 17 Dec 2023 19:44:56 -0800 (PST) Received: from localhost.localdomain ([149.248.38.156]) by smtp.gmail.com with ESMTPSA id 14-20020a17090a19ce00b0028b92b6c657sm431692pjj.2.2023.12.17.19.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 19:44:55 -0800 (PST) From: YunQiang Su To: gcc-patches@gcc.gnu.org Cc: ian@airs.com, pinskia@gmail.com, matoro_mailinglist_gcc-patches@matoro.tk, jakub@redhat.com, YunQiang Su Subject: [PATCH 2/2] libiberty/reconcat: Add note about append string to NULL Date: Mon, 18 Dec 2023 11:44:22 +0800 Message-Id: <20231218034422.2668628-2-syq@gcc.gnu.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231218034422.2668628-1-syq@gcc.gnu.org> References: <20231218034422.2668628-1-syq@gcc.gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: For reconcat, if the `optr` can only be used as the last one of string list, aka, we cannot append something to it. Let's add some note into the document. libiberty: * concat.c (reconcat): Add note about append string to NULL into document. --- libiberty/concat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libiberty/concat.c b/libiberty/concat.c index 4cb1df3baf3..3a6b4ca71e8 100644 --- a/libiberty/concat.c +++ b/libiberty/concat.c @@ -169,6 +169,9 @@ loop: str = reconcat (str, "pre-", str, NULL); @end example +Note: don't try to append string(s) to the a NULL string, +as the process will stop at the first NULL argument. + @end deftypefn */ -- 2.39.2