From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Li Subject: Re: Sparse parsing question: string literal Date: Sun, 20 Aug 2017 12:00:09 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-yw0-f176.google.com ([209.85.161.176]:33894 "EHLO mail-yw0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753064AbdHTQAK (ORCPT ); Sun, 20 Aug 2017 12:00:10 -0400 Received: by mail-yw0-f176.google.com with SMTP id s143so80559677ywg.1 for ; Sun, 20 Aug 2017 09:00:10 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Derek M Jones Cc: Dibyendu Majumdar , Linux-Sparse On Sun, Aug 20, 2017 at 11:16 AM, Derek M Jones 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