--nextPart1739792.OuyeAkC2fj Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 15 June 2007, Michael Olbrich wrote: > Please don't use "" for _any_ installed header. This can result in very > confusing errors. My statement was: Please don't use <> for _any_ installed header. This can= =20 result in very confusing errors. > ----- /usr/include/a/foo.h -------- > #include "bar.h" > ... > ----------------------------------- > > ----- /usr/include/a/bar.h -------- > // something > ----------------------------------- I'd assume a/foo.h and a/bar.h to belong to the same lib or at least libs t= hat=20 have some relation (like kdecore and kdeui). That means if I include a head= er=20 of that lib I want all the dependent headers from the same version of that= =20 lib. I.e. if I include (knowing it'll pick the header a/foo.h) then I'd= =20 expect it to include all dependent headers from a/ and not some other versi= on=20 or even other unrelated lib in some other dir. > ----- /usr/include/b/bar.h -------- > // something else > ----------------------------------- > > /usr/include/b/foo.h does _not_ exist. > > ----- test1.c --------------------- > #include > ... > ----------------------------------- > > ----- test2.c --------------------- > #include > #include > ... > ----------------------------------- > > compiling with -I/usr/include/b/ -I/usr/include/a/ test1.c I'd expect to always compile fine. I'd expect test2.c to fail only = if=20 a/bar.h and b/bar.h use the same include guard. (Now here's a good reason w= hy=20 you should namespace your include guard, too. E.g. all my Phonon headers ha= ve=20 guards of the form PHONON_CLASSNAME_H.) If a and b are incompatible version= s=20 of the same lib then you're supposed to get compile errors - if you don't=20 debugging can get really hairy. > gets different=20 > results for test1.c and test2.c. That is imho wrong. The order in which > headers are included and whether they are included directly or > indirectly (via another header) should never change the result. Can you make your example a bit more concrete? So far it looks designed to= =20 break. Any real world examples? Have you read the rationale on=20 http://techbase.kde.org/Policies/Library_Code_Policy#As_library_developer ? =2D-=20 ________________________________________________________ Matthias Kretz (Germany) <>< http://Vir.homelinux.org/ MatthiasKretz@gmx.net, kretz@kde.org, Matthias.Kretz@urz.uni-heidelberg.de --nextPart1739792.OuyeAkC2fj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGc7A3yg4WnCj6OIoRAldOAJ9RwTHQHZkNuddoON2mtNEeksVuNgCcDUfm 3AMy277il73ga0k3WNO5UcE= =8HrH -----END PGP SIGNATURE----- --nextPart1739792.OuyeAkC2fj--