`Hiding' libc symbols
Harti Brandt
brandt at fokus.fraunhofer.de
Wed May 7 02:18:08 PDT 2003
On Tue, 6 May 2003, Dag-Erling Smorgrav wrote:
DS>"Andrey A. Chernov" <ache at nagual.pp.ru> writes:
DS>> On Tue, May 06, 2003 at 20:40:35 +0200, Dag-Erling Smorgrav wrote:
DS>> > I would like to draw your attention to points b) and c) above and ask
DS>> > how you plan to address them.
DS>> About b), I don't quite understand, what you mean. If inside the same
DS>> application some file includes, say, math.h and use sin() and another file
DS>> not includes math.h and defines its own sin() it is error.
DS>
DS>No. It will lead to surprising results if the file that includes
DS><math.h> really does use sin(), but if it doesn't there is no reason
DS>why the other file can not define an external symbol named sin because
DS>sin is in the application namespace in that file.
No. The non-macro names in the headers that are defined by C are reserved
for external linkage. You may defined a static sin() given that you don't
include math.h, but you may never define an external sin(). (This is point
4 in 7.1.3 (at least in my 8/98 draft)).
harti
--
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org
More information about the freebsd-arch
mailing list