Object and functions with the same name
Bjorn Engsig
bengsig at oracle.nl
Thu Nov 15 22:18:32 AEST 1990
Is the following program with sources in two files strictly conforming,
and where in the ANSI standard are these issues discussed?
--- file1.c ---
#include <stdio.h>
int something = 12345;
extern void dothis();
main(int ac, char **av)
{ dothis(); printf("something = %d\n",something); }
--- file2.c ---
void something() { ; }
void dothis() { something(); }
---------------
Actually, this question arises from the fact, that you could overlook
the existence of a function with a certain name in your libraries (or
the compiler vendor uses one internally, that isn't documented and doesn't
begin with _), and you then define an object with global linkage with the same
name.
--
Bjorn Engsig, E-mail: bengsig at oracle.com, bengsig at oracle.nl
ORACLE Corporation Path: uunet!orcenl!bengsig
"Stepping in others footsteps, doesn't bring you ahead"
More information about the Comp.std.c
mailing list