Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491710

Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Date 2016-09-27 09:10 +0200
Message-ID <slUGC-6wg-39@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <slGaB-5yk-1@gated-at.bofh.it> <slGki-5BO-21@gated-at.bofh.it> <slI2K-6Jd-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Sep 26, 2016 at 08:38:14PM +0300, Sergei Shtylyov wrote:
> >@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> > {
> > 	unsigned char outbuf[80];
> > 	unsigned char c;
> >-	size_t space = sizeof outbuf - 1;
> >+	size_t space = sizeof(outbuf - 1);
> 
>    What?! Does that compile?
> 
> [...]

It prints a Smatch warning.  Smatch ignores these if they happen inside
a macro where you pass a pointer and it takes the sizeof() the argument.

regards,
dan carpenter

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
  [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
    Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:40 +0200
      Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 18:50 +0200
        Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 19:50 +0200
  [PATCH 2/5] ISDN-Gigaset: Improve another size determination in  gigaset_initcs() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
  [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 23:20 +0200
      Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:30 +0200
        Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 10:50 +0200
          Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 11:40 +0200
            Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 11:50 +0200
            Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 12:30 +0200
              Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 13:40 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 14:10 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure isdn@linux-pingi.de - 2016-09-27 14:20 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 15:00 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 16:40 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:40 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 17:20 +0200
    Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:20 +0200
      Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 09:30 +0200
  [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory  allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Tilman Schmidt <tilman@imap.cc> - 2016-09-27 13:00 +0200
      Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:50 +0200
  [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    RE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Laight <David.Laight@ACULAB.COM> - 2016-09-26 18:10 +0200
      Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Joe Perches <joe@perches.com> - 2016-09-26 18:30 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 18:50 +0200
          Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Julia Lawall <julia.lawall@lip6.fr> - 2016-09-26 19:00 +0200
        [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 19:50 +0200
          Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:50 +0200
          Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Miller <davem@davemloft.net> - 2016-09-27 02:20 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:40 +0200
    Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-26 19:40 +0200
      Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by  parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:10 +0200
        Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator  by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
      Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:10 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:30 +0200
  Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 22:40 +0200
    Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:20 +0200
  Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 14:00 +0200
    Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 19:00 +0200
      Re: ISDN-Gigaset: Fine-tuning for three function implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 20:00 +0200

csiph-web