Skip to Content.
Sympa Menu

freetds - Re: [freetds] including readpassphrase.h

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] including readpassphrase.h
  • Date: Tue, 20 Dec 2005 17:08:00 +0100


>
> >However I don't understand the reason
> >to change this include, just to quote original message
> >
> >> The other issue is that it seems to me
> >>
> >> # include <../src/replacements/readpassphrase.h>
> >>
> >> has far too much information hard-coded about where the
> include file
> >is
> >> found and what directory I happen to be in when I'm compiling.
> >
> >specially "... it that it seems ..." why "it seems" and not
> "it is" ??
> >And also "has too much information hard-coded" ... well, it
> the include
> >works I don't see any problems... header is "private" (not
> installed) so
> >if FreeTDS compile is not a problem.
>
> The absence of compile errors on one platform is not proof of good
> coding practices. Whenever I stumble across a portability issue, I
> try to think of what dependencies can be eliminated and describe the
> problem in general terms rather than just saying "it doesn't compile
> in my environment." One of the general principles here is that
> everything between angle brackets or double quotes in an #include
> directive is implementation defined. The more information you have
> in there, the more likely you are to come across a C implementation
> that interprets it differently from yours. The other general
> principle, and the one that is tripping me up, is that where things
> are in relation to each other during the build is information that
> belongs in the build facilities, not in the source code. Had that
> been done from the outset here, we would not even be having this
> discussion.

Well, not using directory informations on #include was one of the
suggestions on portability on "C++ Manuale di Stile" (Carlo Pescio "C++
Style Manual"), a very good book. The main reason why readpassphrase.h
is in src/replacement is that it was on the same directory (I copied
from a BSD style source, see license inside). I added #include in
replacements.h after cvs commit so I decided to use relative include.
This also assure that we use our version instead of possible system one
(or that it do not compile...). A simple way to solve all issues can be
- move src/replacements/readpassphrase.h to include/tds_readpassphrase.h
- do adjustment for correct inclusion (include/replacements.h,
src/replacements/readpassphrase.c)
Does this solution make all happy ?

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page