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


Groups > linux.kernel > #1384727

Re: [PATCH] usb: core: Do not use sizeof on pointer type

From Bjørn Mork <bjorn@mork.no>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: core: Do not use sizeof on pointer type
Date 2016-04-22 09:00 +0200
Message-ID <rqDei-697-5@gated-at.bofh.it> (permalink)
References <rqCie-5m3-13@gated-at.bofh.it>
Organization m

Show all headers | View raw


Vaishali Thakkar <vaishali.thakkar@oracle.com> writes:

> When sizeof is applied to a pointer typed expression, it gives
> the size of the pointer. So, do not use sizeof on pointer type.

What if the intended result was the size of the pointer?

> Problem found using Coccinelle.

Yes, sure.  But you cannot just blindly apply the result without reading
and understanding the code.


Bjørn

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


Thread

[PATCH] usb: core: Do not use sizeof on pointer type Vaishali Thakkar <vaishali.thakkar@oracle.com> - 2016-04-22 08:00 +0200
  Re: [PATCH] usb: core: Do not use sizeof on pointer type Bjørn Mork <bjorn@mork.no> - 2016-04-22 09:00 +0200
  Re: [PATCH] usb: core: Do not use sizeof on pointer type Clemens Ladisch <clemens@ladisch.de> - 2016-04-22 09:00 +0200

csiph-web