From owner-freebsd-current Sun Dec 3 13:31:46 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA25170 for current-outgoing; Sun, 3 Dec 1995 13:31:46 -0800 Received: from asstdc.scgt.oz.au (root@asstdc.scgt.oz.au [202.14.234.65]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA25165 for ; Sun, 3 Dec 1995 13:31:41 -0800 Received: (from imb@localhost) by asstdc.scgt.oz.au (8.6.12/BSD-4.4) id IAA12009; Mon, 4 Dec 1995 08:30:48 +1100 From: michael butler Message-Id: <199512032130.IAA12009@asstdc.scgt.oz.au> Subject: Re: changes in -current..TEST please To: terry@lambert.org (Terry Lambert) Date: Mon, 4 Dec 1995 08:30:47 +1100 (EST) Cc: current@freebsd.org In-Reply-To: <199512032054.NAA09061@phaeton.artisoft.com> from "Terry Lambert" at Dec 3, 95 01:54:41 pm X-Mailer: ELM [version 2.4 PL24beta] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1117 Sender: owner-current@freebsd.org Precedence: bulk Terry Lambert writes: > How is dummy_cleanup "not referenced"? > phaeton: {50} grep dummy_cleanup *.c > kern_xxx.c:dummy_cleanup() {} > kern_xxx.c:TEXT_SET(cleanup_set, dummy_cleanup); > Looks referenced to me. Yes but look at the reference .. from kernel.h .. #define MAKE_SET(set, sym, type) \ static void *const __set_##set##_sym_##sym = \ (&__set_##set##_sym_##sym, &sym, 0); \ asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym) #define TEXT_SET(set, sym) MAKE_SET(set, sym, 23) #define DATA_SET(set, sym) MAKE_SET(set, sym, 25) #define BSS_SET(set, sym) MAKE_SET(set, sym, 27) #define ABS_SET(set, sym) MAKE_SET(set, sym, 21) [ .. etc .. ] .. it's declared "static" which in all my references, means "local to this file" and then referenced externally (by the linker) and not by any code that GCC can see. The resultant compiler behaviour is undefined as far as I'm aware so I don't believe the claim that GCC is broken in this example (in other ways, yes, but not this). Removing "static" tells the compiler to leave it alone as it _might_ be referenced beyond its limited vision, michael