[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C source



L'octidi 28 messidor, an CCXXIV, Jonathan Dowland a écrit :
> Interesting nuance, thanks!
> 
> I wonder if this is why SDL recommends people just use "" for their
> own headers.

The best explanation I can come up with is that their examples where
originally designed as test programs within the source tree. In that case,
the double quote form is not incorrect. Then they forgot to update it when
turning it into examples and documentation.

The <> / "" distinction is always in a grey area when a project is
constructed as a library plus programs using it. My rule of thumb would be
to use "" for tests programs within the library and <> for examples meant
for outside developers using the library. In fact, the example should be
written to work with the library fully installed and the build tree purged,
although they should include Makefile magic to work directly from the build
tree too.

I think that having "" fall back to searching the system headers like <>
does is a bad design decision and encourages sloppy practices. Of course, it
is way too late to fix that now. #include "stdio.h" should be as much an
error as #include <my_project.h>.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature


Reply to: