Return-Path: Received: from [8.12.47.4] ([8.12.47.4]:19007 "EHLO jlevon" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726170AbgAWLBa (ORCPT ); Thu, 23 Jan 2020 06:01:30 -0500 From: john.levon@joyent.com Subject: [PATCH 2/8] alt definition for STANDARD_GNU89 & friends Date: Thu, 23 Jan 2020 02:56:57 -0800 Message-Id: <20200123105703.17454-3-john.levon@joyent.com> In-Reply-To: <20200123105703.17454-1-john.levon@joyent.com> References: <20200123105703.17454-1-john.levon@joyent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: smatch-owner@vger.kernel.org List-ID: To: smatch@vger.kernel.org Cc: Luc Van Oostenryck , John Levon From: Luc Van Oostenryck It may be useful to known the base standard and if we're using the gnu extensions but as these are defined it can only be done on a case-by-case basis. Change these defines so that: * the GNU extensions is the least significant bit * the versions can be easily compared with <, >, <= and >= Signed-off-by: Luc Van Oostenryck Signed-off-by: John Levon --- lib.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib.h b/lib.h index ed2c866a..44e2b5c5 100644 --- a/lib.h +++ b/lib.h @@ -207,13 +207,16 @@ extern int arch_big_endian; extern int arch_mach; enum standard { + STANDARD_NONE, + STANDARD_GNU, STANDARD_C89, + STANDARD_GNU89 = STANDARD_C89 | STANDARD_GNU, STANDARD_C94, + STANDARD_GNU94 = STANDARD_C94 | STANDARD_GNU, STANDARD_C99, + STANDARD_GNU99 = STANDARD_C99 | STANDARD_GNU, STANDARD_C11, - STANDARD_GNU11, - STANDARD_GNU89, - STANDARD_GNU99, + STANDARD_GNU11 = STANDARD_C11 | STANDARD_GNU, }; extern enum standard standard; -- 2.23.0