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


Groups > linux.kernel > #1478270

Re: [PATCH] qed: add missing header dependencies

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] qed: add missing header dependencies
Date 2016-09-07 15:00 +0200
Message-ID <seKCl-8iW-15@gated-at.bofh.it> (permalink)
References <seITU-7oj-11@gated-at.bofh.it> <seJZD-85G-7@gated-at.bofh.it> <seKsG-8fI-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wednesday, September 7, 2016 12:31:03 PM CEST Yuval Mintz wrote:
> > > While I obviously have no strong objection for including
> > > qed_selftest.h from qed_selftest.c, I'm not sure I understand which C
> > > standard dictates this requirement.
> > > Why should a function definition [not call] be preceded by a prototype?
> > 
> > - When a function is defined in one file and used in another, you want
> >   both files to include the same header that has the declaration to
> >   ensure that the types are identical. There are cases where the
> >   prototype is changed after the fact in an incompatible way, causing
> >   silent data corruption on some configurations but maybe not on others.
> 
> O.k., motivation is clear.
> But this really isn't enforced by the ansi-c standard, right?

No, ansi-c doesn't enforce this, and even the regular kernel build
flags don't enable the warning in question, we only get it when
either building with "make C=1" using sparse, or "make W=1" to
enable extra warnings from gcc.

The warning is however really useful, and I hope that we go through
all drivers in the kernel and eliminate these warnings in order
to turn them on by default for all drivers.

> Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>

Thanks,

	Arnd

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


Thread

[PATCH] qed: add missing header dependencies Baoyou Xie <baoyou.xie@linaro.org> - 2016-09-07 13:10 +0200
  RE: [PATCH] qed: add missing header dependencies Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-09-07 14:00 +0200
    Re: [PATCH] qed: add missing header dependencies Arnd Bergmann <arnd@arndb.de> - 2016-09-07 14:20 +0200
      RE: [PATCH] qed: add missing header dependencies Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-09-07 14:50 +0200
        Re: [PATCH] qed: add missing header dependencies Arnd Bergmann <arnd@arndb.de> - 2016-09-07 15:00 +0200
  Re: [PATCH] qed: add missing header dependencies David Miller <davem@davemloft.net> - 2016-09-08 02:50 +0200

csiph-web