Subject: Re: [PATCH] add definitions for global variables to shell.c

From: Junio C Hamano <[email-masked]>
Date: Mon, 18 Aug 2008 17:29:11 -0700

Robert Schiele <[email-masked]> writes:

> Commit 5b8e6f85 introduced stubs for three functions that make no sense
> for git-shell.  But those stubs defined libgit.a functions a second time
> so that a linker can complain.  While commit 78568448 fixes this problem
> it introduces a new issue on the affected systems: Some versions of the
> Sun compiler generate references to global variables when they see
> extern declarations for those, even when they are never used in the
> code.

Haven't looked at the real declarations but if the decl are "extern" and
nobody refers to them, why should the resulting object file require them
to be defined anywhere?  If the decl are not and in (fortran-ish) "common"
section, on the other hand, you shouldn't have to define them yourself
like this either.

This sounds like a compiler bug to me.