Skip to Content.
Sympa Menu

freetds - RE: [freetds] replacement iconv

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] replacement iconv
  • Date: Mon, 15 Dec 2003 11:32:10 -0500

> From: Craig A. Berry [mailto:craigberry AT mac.com]
> Sent: December 15, 2003 2:28 AM
>
>> I understand that using different names prevents
>> accidentally linking in the wrong iconv functions.
>
> Or generating linker warnings due to a multiply defined symbol.
>
>> OTOH, any time we use preprocessor magic, we
>> make understanding our work just that much harder. I'm not
>> sure what the best answer is.
>
> How hard is it to understand a one-line macro? You wouldn't even
> need to understand it unless you were reading config.h to find out
> about the particulars of your environment. We are not talking about
> an #ifdef jungle sprouting up throughout the code, we are just
> talking about a one-time preprocessor override for each function.
>
> I hope this doesn't sound grumpy. I've probably read the wrong
> books, listened to the wrong records, and otherwise corrupted my
> mind, but I honestly don't understand the preprocessor allergy that
> keeps popping up here, especially in light of all the other risks
> that are considered preferable.

Well, Craig, you *do* sound a little grumpy, but probably with cause. I was
relying on my experience, which certainly doesn't encompass all linkers.
Even though no one's complained to date about linker problems with our
libiconv replacement, Frediano's choice (and your defense of it) will
probably save us headaches in the 0.62 release.

My "allergy" to the preprocessor is based on what I think is received
wisdom, that the preprocessor requires the programmer to expand the macro in
his head in order to understand what the compiler is seeing. That, and too
many years of C++, where I learned that the preprocessor is both bad and
obsolete. Which it is. ;-)

I agree, there are trade-offs, and the most convincing one you pointed out
is that linker errors almost defy human interpretation. Anyone who can fix
a multiply defined symbol error can read (and would prefer) a macro
redefining a local name.

Thanks for doing the research and making the case.

Regards,

--jkl

P.S. Did your research say anything about the priority of object files vs.
libraries? If you link in iconv.o, rather than iconv.a, will the linker pay
any more attention? AFAIK, there are no standards that govern any of this;
it's just a matter of practice.

-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page