From owner-freebsd-current Thu Dec 7 03:51:52 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA04877 for current-outgoing; Thu, 7 Dec 1995 03:51:52 -0800 (PST) Received: from critter.tfs.com ([140.145.230.252]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA04872 for ; Thu, 7 Dec 1995 03:51:49 -0800 (PST) Received: from localhost.tfs.com (localhost.tfs.com [127.0.0.1]) by critter.tfs.com (8.6.12/8.6.12) with SMTP id LAA02870; Thu, 7 Dec 1995 11:50:23 GMT X-Authentication-Warning: critter.tfs.com: Host localhost.tfs.com didn't use HELO protocol To: Bruce Evans cc: current@freebsd.org, imb@scgt.oz.au, julian@ref.tfs.com, terry@lambert.org Subject: Re: changes in -current..TEST please In-reply-to: Your message of "Thu, 07 Dec 1995 05:58:15 +1100." <199512061858.FAA31752@godzilla.zeta.org.au> Date: Thu, 07 Dec 1995 12:50:23 +0100 Message-ID: <2868.818337023@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-current@freebsd.org Precedence: bulk > The manual only seems to say that the above stops the warning. gcc-2.7 > has a better method: > > static void dummy_cleanup(void) __attribute__((__unused__)); > > This stops the warning but doesn't stop dummy_cleanup() going away with > -O3 any better than MAKE_SET() (it goes away because it becomes static > inline. static inlines _should_ go away). > > Why not initialize a pointer to the function? Then the function address > _is_ used provided the pointer doesn't go away. Why does the comma > expression end with an 0 anyway? The following seems to work right > (except it wastes a pointer): > > static void (*const foo)(void) = dummy_cleanup; Well, what would prevent gcc from going foo isn't used, zap it. now dummy_cleanup isn't used, zap it. ? -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.