Re: [PATCH 4/8] add helper: valid_type()

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

 



On Sat, Feb 10, 2018 at 11:38:11AM -0800, Christopher Li wrote:
> On Fri, Feb 2, 2018 at 4:17 AM, Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
> > 'bad_type' is used for ... bad types instead of NULL
> > in order to avoid later lots of null-checking.
> 
> Is there a good reason to keep both NULL and "bad_type"
> to represent bad types?
> 
> May be we should keep it simple, make NULL as the
> haven't been evaluated. After evaluate if there is type
> error, replace the NULL as bad type. So that we can tell
> this expression is evaluated or not.
> 
> In other word, replace all usage of NULL as bad type into
> "bad_type". That would be more consistent.

This is indded one of the longer term goal (or at least to
make things much cleaner).
For the moment, it's far from being the case though, because
some of the functions return NULL to indicate that they
failed and then this return value is used and assigned.
It's quite a bit messy.

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