linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <plroskin@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] Add -gcc-version option
Date: Tue, 18 Jul 2017 16:46:47 -0700	[thread overview]
Message-ID: <CAN_72e2SE4pcUNNUSOJVRW31YdXmm-tR0ybOjpT7QDV2fmne4g@mail.gmail.com> (raw)
In-Reply-To: <CANeU7Qn7Te3kxzcWAzC_4Hn2MLSsGFTdNX2AjJwmWdb6e2n+pA@mail.gmail.com>

On Tue, Jul 18, 2017 at 4:35 PM, Christopher Li <sparse@chrisli.org> wrote:
> On Tue, Jul 18, 2017 at 5:59 PM, Pavel Roskin <plroskin@gmail.com> 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.

Yes, that works! I wish I thought of it earlier and did not waste time
writing that patch.

That option may still be useful if sparse attempts to imitate the
behavior of specific gcc versions (in addition to the defines).

-- 
Regards,
Pavel Roskin

  reply	other threads:[~2017-07-18 23:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 21:59 [PATCH] Add -gcc-version option Pavel Roskin
2017-07-18 23:35 ` Christopher Li
2017-07-18 23:46   ` Pavel Roskin [this message]
2017-07-19 13:07     ` Christopher Li
2017-07-19 17:27       ` Pavel Roskin
2017-07-19 19:16         ` Christopher Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN_72e2SE4pcUNNUSOJVRW31YdXmm-tR0ybOjpT7QDV2fmne4g@mail.gmail.com \
    --to=plroskin@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).