All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] the standard for including header files?
@ 2007-05-28 20:35 Robert P. J. Day
  2007-05-28 22:09 ` Randy Dunlap
  2007-05-28 22:35 ` Richard Knutsson
  0 siblings, 2 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-05-28 20:35 UTC (permalink / raw)
  To: kernel-janitors


  in my travels thru the source tree, i've noticed header files like
the following (include/linux/ioctl.h):

#ifndef _LINUX_IOCTL_H
#define _LINUX_IOCTL_H

#include <asm/ioctl.h>

#endif /* _LINUX_IOCTL_H */

  fair enough -- it simply includes the asm-specific form of that
header file, so one can include either of those two header files to
get exactly the same effect.

  but what's the *correct* header file to include?  *at the moment*,
those two includes are equivalent but nothing says they have to be
that way forever.  perhaps some day some arch-independent content is
added to linux/ioctl.h.  if that happens, those files that include
*that* header file will pick up the additional content, while files
that instead include asm/ioctl.h won't.

  it may be that this will never be a problem, but there certainly is
some variety of who is including what in the source tree:

$ grep -r "include.*linux/ioctl.h" * | wc -l
131
$ grep -r "include.*asm/ioctl.h" * | wc -l
40

  there are a few other header files like that:  user.h, param.h, etc.
i'm just wondering what the standard is.

rday
-- 
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
====================================
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-28 22:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-28 20:35 [KJ] the standard for including header files? Robert P. J. Day
2007-05-28 22:09 ` Randy Dunlap
2007-05-28 22:35 ` Richard Knutsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.