Thread (21 messages) 21 messages, 11 authors, 2020-09-12

Re: [GIT] Networking

flat view

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2015-09-03 19:48:20
Also in: lkml

On Thu, Sep 3, 2015 at 12:32 PM, Julia Lawall [off-list ref] wrote:
I find 518 occurrences of a function parameter declaration that contains
an explicit size.  But only the sizeof(mcs_mask) where there is a sizeof
on such a parameter.  I also checked for ARRAY_SIZE on such parameters,
and didn't find any occurrences of that either.
Are there any cases of multi-dimensional arrays? Because those
actually have semantic meaning outside of sizeof(), just in things
like adding offsets.

Eg something like

     int fn(int a[][10])

ends up being equivalent to something like

     int fn(int (*a)[10])

and "a+1" is actually 40 bytes ahead of "a", so it does *not* act like
an "int *".

(And I might have screwed that up mightily - C multidimensional arrays
and the conversions to pointers are really easy to get confused about.
Which is why I hope we don't have them)

                  Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help