[bind10-dev] coding guidelines
JINMEI Tatuya / 神明達哉
jinmei at isc.org
Wed Oct 17 17:45:48 UTC 2012
At Wed, 17 Oct 2012 17:31:18 +0000,
Francis Dupont <fdupont at isc.org> wrote:
> > So, is your concern that since how <> or "" works is
> > implementation-defined, we cannot reliably assume anything anyway, in
> > theory?
>
> => I have two concerns:
> - the first one is very theorical and is the standard doesn't really
> specify something useful. But again it is in theory so without
> a concrete counter-example in a system or compiler you support,
> it should not become an issue
Okay.
> - the second is about the < > fallback: it makes impossible to enforce
> the choice of the "right" include, or with other words there is no
> provable protection against errors. IMHO this makes the " " variant
> far less attractive...
I'm afraid I don't get it...I don't have a strong opinion on this so
I'm not defending "", but my understanding of the argument for "" is
something like this:
If we have foo.h and foo.cc in directory dir1, also have another foo.h in
another directory dir2, then
- if we use '#include "foo.h"' in foo.cc, we can reasonably (though
possibly implementation-defined in theory) assume dir1/foo.h will be
used.
- if we use '#include <foo.h>' in foo.cc, it may mean dir1/foo.h or
dir2/foo.h depending on whether the build environment has -Idir1 or
-Idir2, and which one is specified first.
Aside from whether it's convincing for preferring "", it at least
seems to be understandable, and if we discuss this based on common
compiler behavior (not based on theoretical implementation-defined
one), the first choice is a reasonably "enforcible" way to choose
dir1/foo.h, right?
---
JINMEI, Tatuya
More information about the bind10-dev
mailing list