Re: [PATCH] Add -gcc-version option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 18, 2017 at 4:35 PM, Christopher Li <sparse@xxxxxxxxxxx> wrote:
> On Tue, Jul 18, 2017 at 5:59 PM, Pavel Roskin <plroskin@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux