Re: [PATCH] evaluate: Allow sizeof(_Bool) to succeed.

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

 



On Mon, May 9, 2011 at 1:49 PM, Ben Pfaff <blp@xxxxxxxxxx> wrote:
> The 'fault' member is 3-valued: a null pointer means that the row has
> an empty "fault" column; otherwise it points either to a malloc()'d
> true or false value.  The warning then crops up in the generated code
> for populating this struct, which does something similar to the
> following when the "fault" column is nonempty:
>
>    row->fault = xmalloc(sizeof *row->fault);
>    *row->fault = /* value parsed from database row */;

I don't see particular things wrong with it. Personally I think malloc is
a bit overkill here. It will likely pad the area to natural machine int size
any way.

> I could change my IDL code generator to do something different for
> this case, but I don't see anything actually wrong with it.  This
> userspace code is not performance-critical or sensitive to memory
> usage, so it's not necessary on the face of it to optimize it.

Removing the warning will lose the chance to see it on other potential
problematic usage. If you insist on no warning. You can submit a patch
to add a switch to disable it. We have a lot of those for fine grain warning
control. I just don't see this warning can hurt on the kernel checking side.

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