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


Groups > linux.kernel > #1218505

Re: [GIT] Networking

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [GIT] Networking
Date 2015-09-03 20:40 +0200
Message-ID <q4HAu-3ib-27@gated-at.bofh.it> (permalink)
References <q4vpF-2GW-25@gated-at.bofh.it> <q4FS3-M8-27@gated-at.bofh.it> <q4GO6-28h-25@gated-at.bofh.it> <q4HqO-37a-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 3, 2015 at 11:22 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> [-Wsizeof-array-argument]

Ahh. Google shows that it's an old clang warning that gcc has recently
picked up.

But even clang doesn't seem to have any way for a project to say
"please warn about arrays in function argument declaration". It *is*
very traditional idiomatic C, it's just that I personally think it's
one of those bad traditional C things exactly because it's so
misleading about what actually goes on. But I guess that in practice,
the only thing that it actually *affects* is "sizeof" (and assignment
to the variable name - something that would be invalid for a real
array, but works on argument arrays because they are really just
pointers).

The "array as function argument" syntax is occasionally useful
(particularly for the multi-dimensional array case), so I very much
understand why it exists, I just think that in the kernel we'd be
better off with the rule that it's against our coding practices.

                  Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-03 18:50 +0200
  Re: [GIT] Networking David Miller <davem@davemloft.net> - 2015-09-03 19:50 +0200
    Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-03 20:30 +0200
      Re: [GIT] Networking Joe Perches <joe@perches.com> - 2015-09-03 20:40 +0200
        Re: [GIT] Networking Julia Lawall <julia.lawall@lip6.fr> - 2015-09-03 21:40 +0200
          Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-03 21:50 +0200
            Re: [GIT] Networking Julia Lawall <julia.lawall@lip6.fr> - 2015-09-03 23:00 +0200
              Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-03 23:10 +0200
                Re: [GIT] Networking Julia Lawall <julia.lawall@lip6.fr> - 2015-09-03 23:30 +0200
      Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-03 20:40 +0200
        Re: [GIT] Networking Marcel Holtmann <marcel@holtmann.org> - 2015-09-03 23:10 +0200
          RE: [GIT] Networking David Laight <David.Laight@ACULAB.COM> - 2015-09-04 11:10 +0200
            Re: [GIT] Networking "Rustad, Mark D" <mark.d.rustad@intel.com> - 2015-09-04 19:40 +0200
      Re: [GIT] Networking David Miller <davem@davemloft.net> - 2015-09-03 20:50 +0200
  Re: [GIT] Networking Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> - 2015-09-05 18:20 +0200

csiph-web