problem with cc compiler

David F. Carlson dave at micropen
Fri Jul 28 01:39:04 AEST 1989


In article <1185 at fcs280s.ncifcrf.gov>, kml at ncifcrf.gov (Kevin Lahey) writes:
] In article <10589 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
] >In article <712 at unsvax.NEVADA.EDU> willey at arrakis.uucp (James P. Willey) says:
] >>... I finally realized that the function name "read" was the culprit.
] >
] >I assume that your problem was that getchar() eventually called read(),
] >expecting the version in the system's C library, but instead found one
] >you had written as part of your program.
] >
] 
] then I could see how to avoid a collision.  I just don't quite see 
] how to insure that a regular function declaration doesn't override
] a library function.  Assuming that this magic system works (I don't
] doubt that it does), how can one override a library function when desired?
] 
] I made a brief perusal of the second edition of K & R, but I was
] not enlightened.  Could you give me some pointers about where to look?
] Obviously, I'm not all up on the new ANSI-C stuff, but I want to be.

One way available under sysV is to use the -M flag for ld(1).  The loader
will barf loudly if a duplicate extern reference occurs.  This is 
not a language "problem" as much as it is a link-loader problem.  C does
allow implicit referencing and seperate compilation.

(A programmer once named a function kill().  *Very* ugly things happened.)


-- 
David F. Carlson, Micropen, Inc.
micropen!dave at ee.rochester.edu

"The faster I go, the behinder I get." --Lewis Carroll



More information about the Comp.lang.c mailing list