From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Li Subject: Re: [PATCH] Add -gcc-version option Date: Tue, 18 Jul 2017 19:35:14 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-pg0-f43.google.com ([74.125.83.43]:34417 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbdGRXfP (ORCPT ); Tue, 18 Jul 2017 19:35:15 -0400 Received: by mail-pg0-f43.google.com with SMTP id 123so20688865pgj.1 for ; Tue, 18 Jul 2017 16:35:14 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Pavel Roskin Cc: Linux-Sparse On Tue, Jul 18, 2017 at 5:59 PM, Pavel Roskin wrote: > The option argument is parsed into major, minor and patchlevel versions, > which are defined as __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__ in > the preprocessor. > > One possible use is running sparse compiled with the lastest gcc compiler > on a Linux kernel that doesn't support that compiler. I am curious, can you just invoke sparse with -D__GNUC__=1 -D__GNUC_MINOR__=2 to do the same thing? The current __GNUC__ was a weak define it is suitable for overriding if you wants to. Chris