lkml.org 
[lkml]   [2016]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] qed: add missing header dependencies
Date
> > 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?

Anyway, thanks.

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

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.048 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site