This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Make dl-fxstatat64.c include of fxstatat64.c use <> not ""
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 22 Aug 2012 16:57:55 -0700 (PDT)
- Subject: Re: Make dl-fxstatat64.c include of fxstatat64.c use <> not ""
- References: <Pine.LNX.4.64.1208222343270.5229@digraph.polyomino.org.uk>
I think this is in the "obvious" category. Nearly all #include's in
libc source should use <> syntax rather than "" syntax. The only
exceptions are "../foo" cases (e.g. "../test-skeleton.c" and
"../libio/libioP.h"). In many places, especially in test cases, it
really doesn't matter either way and there's no particular reason to go
and change them all. But in actual library code, anything that's not
"../foo" should use <> instead, and any "../foo" cases should have some
particular legitimate reason. For the most part, we prefer explicit
things like #include <sysdeps/foo/bar/baz.c>. There are some cases
where the naive conversion breaks, such as:
nptl/sysdeps/unix/sysv/linux/sigtimedwait.c:2:#include "../../../../../sysdeps/unix/sysv/linux/sigtimedwait.c"
Here the obvious:
#include <sysdeps/unix/sysv/linux/sigtimedwait.c>
would actually make the file include itself. But probably it should
change to:
#include <nptl/../sysdeps/unix/sysv/linux/sigtimedwait.c>
so it's not dependent on the location of the including file.
Thanks,
Roland