Re: [PATCH v3 6/7] make process_decl() aware of the presence of an initializer

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

 



On Sun, Mar 05, 2017 at 10:49:37PM +0800, Christopher Li wrote:
> This can be written as:
> 
> int has_init = !is_typedef && match_op(token, '=');
> if (has_init) {

Yes, it can.
But honestly I absolutely detest this 'has_init'.

>      ....
> 
> Passing the "has_init" into a call back function make the code hard to
> read because the logic has separated into two function. At the same time
> process_for_loop_decl does not issue this warning at all, I think it should.

Since I just realize that this 'has_init' is not needed as we can
simply test the presence of decl->initializer, I'll remove it.
 
> I will apply this patch for sparse-next, I agree the warning is useful
> behavior. I am also expecting a follow up patch.

Yes.
Don't bother to add it to sparse-next, I'll send another version later.


Luc
--
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