Re: [PATCH] add definitions for global variables to shell.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 19, 2008, 00:29 UTC
- Message-ID
- <7vy72tkfu0.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080818123727.GB11842@schiele.dyndns.org>
Robert Schiele <rschiele@gmail.com> writes:
Show 7 quoted lines
> 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.