From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kbdG8-0004js-Mk for mharc-grub-devel@gnu.org; Sun, 08 Nov 2020 00:29:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbdG6-0004h2-W0 for grub-devel@gnu.org; Sun, 08 Nov 2020 00:28:59 -0500 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:45272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbdG4-0005jj-3b for grub-devel@gnu.org; Sun, 08 Nov 2020 00:28:58 -0500 Received: by mail-ed1-x543.google.com with SMTP id q3so5301055edr.12 for ; Sat, 07 Nov 2020 21:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mVwtaYX0HK8Cas0YwLajqwxJPlrpoE2jpSNzcSPN92s=; b=qKedJA+cItmfEGAPWPy9Z+PNbhjQL9jR07lzQiAh3bCepcHVcyw/npAoS0Q6F1fhCs CmkbWIOcLPxsC8oY0QZMuZMaF3aI/xaW1+wmvaAhBqASA1u3QWtb0jQEEFX90blIUTmK XvVoPkBEGGVMLS4gg7wDR8xOR6ypI/FhU+64XzULRGhUwli2EGyeA8Y7bFqOXDvZmv5J cfUZPAosGPIhm0pxUkWRNuJibwkUYrLbZ7pZ/IrrYtEaZ6EXjT/oLllardwhwnPJQBjh KsHfotq4rL51Uj2jHUkt7J7eHmySUrQD6dZlr+CGwx9YTUcORSiWBI/ax4M2YJLZgVLT sX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mVwtaYX0HK8Cas0YwLajqwxJPlrpoE2jpSNzcSPN92s=; b=NFIrqLWf1V27Y9UqvTFGLUo7czhVmf9pL8QQOKFDXvpWAEyfe285TAl2E2n6auS5fQ ZqfEm/qjNFkpe3lhohbFnrqC0LjHbnCENJQlC6oAH8qC00SBzrZG0xauaXTCQUiAmtNu Q1FhhcSTQrVDEhXEq9d4a13gH8A/5vYrH1r8TAvtvSmUVmBfrJb9r2T/OawecrnrnKza kz2nWgQ7Dm8TgusrjPPbnIaD1gWGD4tIu8kKsiPjJgzf5h2dKbjIHdiTk5gq0oqsTblN Zu+xq9K5toMQoJsdjQga/B5gU4BZ4UwfiNtQ6OdqfOjf2V8+aL6VVqNKk3cjrr1OKPHI zTmA== X-Gm-Message-State: AOAM531RtX79BloNnk3GnWEHUsLX1BsDlD+5/WXlCtIcX7Qd9bwopTb7 ISFPSXQEZ/ir9PaU7+L2hojGHPpVekNd5Q== X-Google-Smtp-Source: ABdhPJxY3Rt5BTTakX0Z2cdE5LNA2GRz+Q2dQTfPHlNNzVlEiN4JEQ5IQNCr7MaypDZ2kaVD6b/KYg== X-Received: by 2002:a50:d942:: with SMTP id u2mr9576663edj.202.1604813334089; Sat, 07 Nov 2020 21:28:54 -0800 (PST) Received: from localhost.localdomain ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id b1sm4930526edw.27.2020.11.07.21.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Nov 2020 21:28:53 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [PATCH v2 2/2] error: Do compile-time format string checking on grub_error. Date: Sat, 7 Nov 2020 23:26:19 -0600 Message-Id: <18890b2489c342eb289c50f09a62cb463766682b.1604812408.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: <20201005061739.640766-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::543; envelope-from=development@efficientek.com; helo=mail-ed1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 05:28:59 -0000 This should prevent the current situation where there were many format string errors found and thus improve the quality of error reporting. Signed-off-by: Glenn Washburn --- include/grub/err.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/err.h b/include/grub/err.h index 24ba9f5f5..b08d5d0de 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -85,7 +85,8 @@ struct grub_error_saved extern grub_err_t EXPORT_VAR(grub_errno); extern char EXPORT_VAR(grub_errmsg)[GRUB_MAX_ERRMSG]; -grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *fmt, ...); +grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *fmt, ...) + __attribute__ ((format (GNU_PRINTF, 2, 3))); void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_error_push) (void); int EXPORT_FUNC(grub_error_pop) (void); -- 2.27.0