Re: Sparse parsing question: string literal

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

 



On Sun, Aug 20, 2017 at 11:16 AM, Derek M Jones <derek@xxxxxxxxxxxx> wrote:
>
> You forgot the static keyword:
> Sentence 903:
> http://c0x.coding-guidelines.com/6.4.5.html

Thanks for catching that. You are right. They need to be static as well.
I kind of expect that to be const as well. The stander did not put const
as requirement. Just said modify the string is undefined.

>
> But depending on context a conversion occurs.
> Sentence 729:
> http://c0x.coding-guidelines.com/6.3.2.1.html
>
> and your example is one where such a conversion occurs.

Thanks for pointing it out. Interesting read.

BTW, unrelated to string literal but relate to 729.

Do you have any comment on sparse giving warning of:
sizeof(function_name)?

The programmer usually mean sizeof(&function_name).
But 729 said sizeof is such a special case the function degenerate
into pointers does not work inside sizeof().

Should sparse give warning for sizeof(function_name) at all?

Thanks

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