Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Dec 1995 12:50:23 +0100
From:      Poul-Henning Kamp <phk@critter.tfs.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        current@freebsd.org, imb@scgt.oz.au, julian@ref.tfs.com, terry@lambert.org
Subject:   Re: changes in -current..TEST please 
Message-ID:  <2868.818337023@critter.tfs.com>
In-Reply-To: Your message of "Thu, 07 Dec 1995 05:58:15 %2B1100." <199512061858.FAA31752@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2868.818337023>