[comp.std.c] Object and functions with the same name

bengsig@oracle.nl (Bjorn Engsig) (11/15/90)

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@oracle.com, bengsig@oracle.nl
ORACLE Corporation    Path:   uunet!orcenl!bengsig

            "Stepping in others footsteps, doesn't bring you ahead"

gwyn@smoke.brl.mil (Doug Gwyn) (11/16/90)

In article <1118@nlsun1.oracle.nl> bengsig@oracle.nl (Bjorn Engsig) writes:
>Is the following program with sources in two files strictly conforming,

No.

>and where in the ANSI standard are these issues discussed?

3.7 Constraints second paragraph.