From patchwork Sat Jun 8 18:37:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13691075 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C678A1F5FF for ; Sat, 8 Jun 2024 18:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.108.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871878; cv=none; b=CsfBUpXzOu2ed7PHwNToeCR1UhlYS3RtRENj+arMdI/Q7Wi+R+6fJ1tm0/LDMcmnsF92un5Gtxwo9znaQXncFE+NVqxDASdVZHrPDXT8K3YAnhyOiLlRd9fpgaDMwsjufW8Y0hbievmTlY9T/ENwO1Kl+QY6F7mZkcp6rFlZ/18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871878; c=relaxed/simple; bh=zT68Vgoiz2sXwkiHyYmpcvWEiWyETAkh+Ec1nT9nBl4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PcSgvGm0YJvautTxM3I9oH+g1GGdzp2MwPhwoElnUowOkMLU+FPBBYnwRNGBAuedtZ32ugSXRwAur/IiBnrB0DaN8YaK1UygaHbwKlrGimNzNixvq0bxSIH3pBIosq4BKUjWVYTW1Q/9b+uMw7fOh4P9hjYD92iGc/iajTdhklQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=Lb50/Rmb; arc=none smtp.client-ip=64.147.108.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="Lb50/Rmb" Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 66ECC38CC8; Sat, 8 Jun 2024 14:37:50 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=zT68Vgoiz2sXwkiHyYmpcvWEi WyETAkh+Ec1nT9nBl4=; b=Lb50/RmbTco/s3CgNkaqEZ1pznOKPjsW2BLRR/IUX zLyKfT+tJ3H15WkDiut5aL3IQCMZAU9bw1JDByWCfE918j6r6bU9sGGoZnW9in16 4Xs7ajOQXq8aONYA+bpW44C3CKamf1bywjCX/8HGWCeWoENBFeSjBpM4KOktLHkh WM= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 5FB0638CC7; Sat, 8 Jun 2024 14:37:50 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.125.204.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id C7CAA38CC6; Sat, 8 Jun 2024 14:37:49 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH 1/4] __attribute__: trace2_region_enter_printf() is like "printf" Date: Sat, 8 Jun 2024 11:37:44 -0700 Message-ID: <20240608183747.2084294-2-gitster@pobox.com> X-Mailer: git-send-email 2.45.2-445-g1b76f06508 In-Reply-To: <20240608183747.2084294-1-gitster@pobox.com> References: <20240608183747.2084294-1-gitster@pobox.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pobox-Relay-ID: 3537203C-25C6-11EF-A55A-6488940A682E-77302942!pb-smtp2.pobox.com The last part of the parameter list the function takes is like parameters to printf. mark it as such. An existing call that formats a value of type size_t using "%d" was found by the compiler with the help with this annotation; fix it. Signed-off-by: Junio C Hamano --- run-command.c | 3 ++- trace2.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/run-command.c b/run-command.c index 1b821042b4..ec2c12e98b 100644 --- a/run-command.c +++ b/run-command.c @@ -1753,7 +1753,8 @@ void run_processes_parallel(const struct run_process_parallel_opts *opts) if (do_trace2) trace2_region_enter_printf(tr2_category, tr2_label, NULL, - "max:%d", opts->processes); + "max:%"PRIuMAX, + (uintmax_t)opts->processes); pp_init(&pp, opts, &pp_sig); while (1) { diff --git a/trace2.h b/trace2.h index 1f0669bbd2..19e04bf040 100644 --- a/trace2.h +++ b/trace2.h @@ -390,6 +390,7 @@ void trace2_region_enter_printf_va_fl(const char *file, int line, trace2_region_enter_printf_va_fl(__FILE__, __LINE__, (category), \ (label), (repo), (fmt), (ap)) +__attribute__((format (printf, 6, 7))) void trace2_region_enter_printf_fl(const char *file, int line, const char *category, const char *label, const struct repository *repo, From patchwork Sat Jun 8 18:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13691076 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6506C20B3E for ; Sat, 8 Jun 2024 18:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.228.157.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871882; cv=none; b=AkLJKVhwzZvwvWkmCvL9NgVXwDQIPWAD8qXXVF2x2co4kEDdJpwp5c4xOuwmVhWzQ5fFPilJP1YhErkHtxWCnPybvduwpM/mrrJ1A78K0WK7xQMFVmA601RC7bDJZi5QK9LN4f0B8qOaDPe22BTQjWgP8pozzeQlOfRgn+7bv5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871882; c=relaxed/simple; bh=29eQvUCTRMD/W0/Vx1p6+SlqGNQzgWr2QXEUZDywyfA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bZMAU4IyWE12CYYyzL0GLTDPQRoHbmMPdBp97PFmwAr7olJHLZ+Q7SI+dTmTkq7pF29d44YpucomhjFv4EM5XI/6n/BtCp0lxW24ntr5iseXzUxIU6cqQ1Zz2udkcqEcXM7zXESeq/hlOW4hfF5RiP/jXQfGWMOVDOW/gNtJm9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=UNApbzd6; arc=none smtp.client-ip=173.228.157.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="UNApbzd6" Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 13368331AE; Sat, 8 Jun 2024 14:37:55 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=29eQvUCTRMD/W0/Vx1p6+SlqG NQzgWr2QXEUZDywyfA=; b=UNApbzd6VDWoIhdmAT2w2t9+6jemxI0y4mU3WkvW2 /H9eFtSdwSGTWCEw6QPy+rFweSdRr4KtEsmginNvqZ8YOoIuY2Yym9YyoFDOUoEO umG7Z26tPknc/mZcoi7yopJkXwzlcoXKFTv4ThlOka0tKC2ol3zLR0x8iUqtBpTJ yU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 0BD4A331AD; Sat, 8 Jun 2024 14:37:55 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.125.204.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id BAD46331AB; Sat, 8 Jun 2024 14:37:51 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH 2/4] __attribute__: remove redundant attribute declaration for git_die_config() Date: Sat, 8 Jun 2024 11:37:45 -0700 Message-ID: <20240608183747.2084294-3-gitster@pobox.com> X-Mailer: git-send-email 2.45.2-445-g1b76f06508 In-Reply-To: <20240608183747.2084294-1-gitster@pobox.com> References: <20240608183747.2084294-1-gitster@pobox.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pobox-Relay-ID: 365FED36-25C6-11EF-B810-ACC938F0AE34-77302942!pb-smtp20.pobox.com The convention is to declare the function attribute to an extern function together with its declaration in the header file, without repeating the attribute declaration with its definition in the .c source file (a file-scope static function declares its attribute together with its definition in the .c file it is defined, as there is no other place to do so). The definition of git_die_config() in config.c did not follow the convention and had its attribute declared with both its declaration in the header and its definition in the .c source file. Remove the one in the config.c to match everybody else. Signed-off-by: Junio C Hamano --- config.c | 1 - 1 file changed, 1 deletion(-) diff --git a/config.c b/config.c index abce05b774..ea355f28ec 100644 --- a/config.c +++ b/config.c @@ -2844,7 +2844,6 @@ void git_die_config_linenr(const char *key, const char *filename, int linenr) key, filename, linenr); } -NORETURN __attribute__((format(printf, 2, 3))) void git_die_config(const char *key, const char *err, ...) { const struct string_list *values; From patchwork Sat Jun 8 18:37:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13691077 Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BA8F20B3E for ; Sat, 8 Jun 2024 18:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.228.157.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871885; cv=none; b=GG8Du1FHrxL0yudZfI0olTpZ8n8NO2QT1sdSDBV3swmp3tYe1x+V3Q8+JhW/gg39q+Q4p2xZtcV/wV60AE0fiyhM2Iyg7aHhVEt4xjfx4i8+zRuXBYW+uWnJEBpsX5G8UXDenKk6bJsYbqkNMoSciXBVeUEup/oemqlAjB1dlP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871885; c=relaxed/simple; bh=XvRZIBdceofUvcMn6XOO4psWr8m2EK0JROr01LjShlQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fv0l0/BdvisDM2F3oxRCfJ3K7BZ4CgXAnXwtC5HTvE3BvbLQ/zgag8e5hRDo5/TfvSQqfLqN46sGJUcefVKMozKYiLLt6sAuDhBBgyTzOTVe5nGoLgcpMOTfv71Pr9qSXshafn9jM/HrZjnk4tC7TMNeU9Hdr6TwXa2NS9fceIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=CnBtjevd; arc=none smtp.client-ip=173.228.157.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="CnBtjevd" Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id B060A1FCC9; Sat, 8 Jun 2024 14:37:58 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=XvRZIBdceofUvcMn6XOO4psWr 8m2EK0JROr01LjShlQ=; b=CnBtjevdNRE3o/lWYYh5YyK4ol5SiixaD8E7n4zt7 O5YpVlCWHSQYaYMc4vkIoKtFWBXQkZZlSjjEgSIAJpzj04/e4iFj0otpQC3x94Hq I4uMrU/SMRAomzz7l30yYx5UabABl3b5JJ7py90VvZCFpUh7rP1uEJqau75IhrHZ yE= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id A95BA1FCC8; Sat, 8 Jun 2024 14:37:58 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.125.204.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 629AE1FCC7; Sat, 8 Jun 2024 14:37:55 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH 3/4] __attribute__: mark some functions with LAST_ARG_MUST_BE_NULL Date: Sat, 8 Jun 2024 11:37:46 -0700 Message-ID: <20240608183747.2084294-4-gitster@pobox.com> X-Mailer: git-send-email 2.45.2-445-g1b76f06508 In-Reply-To: <20240608183747.2084294-1-gitster@pobox.com> References: <20240608183747.2084294-1-gitster@pobox.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pobox-Relay-ID: 388B32BE-25C6-11EF-9799-8F8B087618E4-77302942!pb-smtp21.pobox.com Some varargs functions that use NULL-terminated parameter list were missing __attributes__ ((sentinel)) aka LAST_ARG_MUST_BE_NULL. Add them. Signed-off-by: Junio C Hamano --- add-patch.c | 1 + attr.h | 2 ++ hook.h | 1 + scalar.c | 1 + 4 files changed, 5 insertions(+) diff --git a/add-patch.c b/add-patch.c index 814de57c4a..d8ea05ff10 100644 --- a/add-patch.c +++ b/add-patch.c @@ -299,6 +299,7 @@ static void err(struct add_p_state *s, const char *fmt, ...) va_end(args); } +LAST_ARG_MUST_BE_NULL static void setup_child_process(struct add_p_state *s, struct child_process *cp, ...) { diff --git a/attr.h b/attr.h index e7cc318b0c..bb33b60880 100644 --- a/attr.h +++ b/attr.h @@ -190,6 +190,8 @@ struct attr_check { }; struct attr_check *attr_check_alloc(void); + +LAST_ARG_MUST_BE_NULL struct attr_check *attr_check_initl(const char *, ...); struct attr_check *attr_check_dup(const struct attr_check *check); diff --git a/hook.h b/hook.h index 19ab9a5806..6511525aeb 100644 --- a/hook.h +++ b/hook.h @@ -86,5 +86,6 @@ int run_hooks(const char *hook_name); * argument. These things will be used as positional arguments to the * hook. This function behaves like the old run_hook_le() API. */ +LAST_ARG_MUST_BE_NULL int run_hooks_l(const char *hook_name, ...); #endif diff --git a/scalar.c b/scalar.c index 331b91dbdb..62dd77aaec 100644 --- a/scalar.c +++ b/scalar.c @@ -70,6 +70,7 @@ static void setup_enlistment_directory(int argc, const char **argv, strbuf_release(&path); } +LAST_ARG_MUST_BE_NULL static int run_git(const char *arg, ...) { struct child_process cmd = CHILD_PROCESS_INIT; From patchwork Sat Jun 8 18:37:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13691078 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 570631CAB9 for ; Sat, 8 Jun 2024 18:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.108.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871887; cv=none; b=eDeLut06v3SpBs69VCtapeEkWEExeWjaEveJBQEn5DsbSS0fgkgQJ0Nny9SRpPcOGW+LeqlkgGjOK1p8AGfU2BVWiB6mcKCNjMDZ46nO64e+XvWXR8tzBGLAWbIY2E4C/buA07ek82J0HLWB2zkAaeCYBNdHQLeYkZgcuEWBK1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717871887; c=relaxed/simple; bh=jf6tOsW6mpj1Rz9S1Y+UVFK/4j3K7rBSX8Tk2mTq/Cw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eLq4aZeco3SVBKSywNV3ePHaIyIwHfFhAtniO+x1NCBJsuMDEvaqHtpC7A0zqCRKS/Edg1j6HsgvxuQfZ2C+h81ieyDMOgzPOAOOxnW8PkhvJgkfa3Cf7sNU3hjgbEOdD7C6rBa1eMWTYR+Jk4Zme3niyAMw1HL5mWl+wdGV/Vw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=x+C5kyp9; arc=none smtp.client-ip=64.147.108.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="x+C5kyp9" Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4AC28209A9; Sat, 8 Jun 2024 14:37:59 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=jf6tOsW6mpj1Rz9S1Y+UVFK/4 j3K7rBSX8Tk2mTq/Cw=; b=x+C5kyp9O2ywt7YMk0OG9iVtTi2o0NOMBKNGZ4OC7 l7HrBBuLZl1fPnrGbuKU//eyiKoKbmhIMwXIrvU4tLeFmyFGNPGSRuWXIXVt+2QY HNgrtFHp+1XLJHdGqbPQBp0Q4FBS1Yk514kbD5ynSWtHWhm5ztKah3R7ZgNa4QNc +8= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4334F209A8; Sat, 8 Jun 2024 14:37:59 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.125.204.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id A7996209A7; Sat, 8 Jun 2024 14:37:58 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH 4/4] __attribute__: add a few missing format attributes Date: Sat, 8 Jun 2024 11:37:47 -0700 Message-ID: <20240608183747.2084294-5-gitster@pobox.com> X-Mailer: git-send-email 2.45.2-445-g1b76f06508 In-Reply-To: <20240608183747.2084294-1-gitster@pobox.com> References: <20240608183747.2084294-1-gitster@pobox.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pobox-Relay-ID: 3A805E46-25C6-11EF-8C85-B84BEB2EC81B-77302942!pb-smtp1.pobox.com A public function mem_pool_strfmt() takes printf like parameters, but is not given an attribute as such. Also a few file-scope static functions were missing their format attribute. Add them. Signed-off-by: Junio C Hamano --- mem-pool.h | 1 + scalar.c | 1 + wt-status.c | 1 + 3 files changed, 3 insertions(+) diff --git a/mem-pool.h b/mem-pool.h index d1c66413ec..321d86a63c 100644 --- a/mem-pool.h +++ b/mem-pool.h @@ -50,6 +50,7 @@ char *mem_pool_strndup(struct mem_pool *pool, const char *str, size_t len); /* * Allocate memory from the memory pool and format a string into it. */ +__attribute__((format (printf, 2, 3))) char *mem_pool_strfmt(struct mem_pool *pool, const char *fmt, ...); /* diff --git a/scalar.c b/scalar.c index 62dd77aaec..a8318078c9 100644 --- a/scalar.c +++ b/scalar.c @@ -289,6 +289,7 @@ static int unregister_dir(void) } /* printf-style interface, expects `=` argument */ +__attribute__((format (printf, 1, 2))) static int set_config(const char *fmt, ...) { struct strbuf buf = STRBUF_INIT; diff --git a/wt-status.c b/wt-status.c index ff4be071ca..c4dac01999 100644 --- a/wt-status.c +++ b/wt-status.c @@ -126,6 +126,7 @@ void status_printf(struct wt_status *s, const char *color, va_end(ap); } +__attribute__((format (printf, 3, 4))) static void status_printf_more(struct wt_status *s, const char *color, const char *fmt, ...) {