Date: Mon, 4 Dec 1995 08:30:47 +1100 (EST) From: michael butler <imb@scgt.oz.au> To: terry@lambert.org (Terry Lambert) Cc: current@freebsd.org Subject: Re: changes in -current..TEST please Message-ID: <199512032130.IAA12009@asstdc.scgt.oz.au> In-Reply-To: <199512032054.NAA09061@phaeton.artisoft.com> from "Terry Lambert" at Dec 3, 95 01:54:41 pm
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512032130.IAA12009>