Message ID | 20140701122057.GA14888@spoyarek.pnq.redhat.com |
---|---|
State | Superseded |
Headers |
Received: (qmail 2830 invoked by alias); 1 Jul 2014 12:19:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 2756 invoked by uid 89); 1 Jul 2014 12:19:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Tue, 1 Jul 2014 17:50:57 +0530 From: Siddhesh Poyarekar <siddhesh@redhat.com> To: libc-alpha@sourceware.org Subject: [PATCH] Fix -Wundef warning on PAGE_COPY_THRESHOLD Message-ID: <20140701122057.GA14888@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) |
Commit Message
Siddhesh Poyarekar
July 1, 2014, 12:20 p.m. UTC
The PAGE_COPY_THRESHOLD macro is meant to be overridden by architecture-specific pagecopy.h, but it is currently done only by mach; all other architectures use the default. Check to see if the macro is defined in addition to whether it is set to a non-zero value. Verified that the generated code is unchanged on x86_64. Siddhesh * sysdeps/generic/pagecopy.h: Also check if PAGE_COPY_THRESHOLD is defined. --- sysdeps/generic/pagecopy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Jul 01, 2014 at 05:50:57PM +0530, Siddhesh Poyarekar wrote: > The PAGE_COPY_THRESHOLD macro is meant to be overridden by > architecture-specific pagecopy.h, but it is currently done only by > mach; all other architectures use the default. Check to see if the > macro is defined in addition to whether it is set to a non-zero value. > > Verified that the generated code is unchanged on x86_64. > > Siddhesh > > * sysdeps/generic/pagecopy.h: Also check if > PAGE_COPY_THRESHOLD is defined. > > --- > sysdeps/generic/pagecopy.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/generic/pagecopy.h b/sysdeps/generic/pagecopy.h > index 2c35b71..2862270 100644 > --- a/sysdeps/generic/pagecopy.h > +++ b/sysdeps/generic/pagecopy.h > @@ -39,7 +39,7 @@ > */ > > > -#if PAGE_COPY_THRESHOLD > +#if defined PAGE_COPY_THRESHOLD && PAGE_COPY_THRESHOLD > > #include <assert.h> > > -- > 1.9.3 > looks ok.
This is not the way to do this. Really the contents of pagecopy.h should move to memcopy.h, and generic/pagecopy.h should do nothing but #define PAGE_COPY_THRESHOLD 0.
On Tue, Jul 01, 2014 at 09:23:05AM -0700, Roland McGrath wrote: > This is not the way to do this. > > Really the contents of pagecopy.h should move to memcopy.h, and > generic/pagecopy.h should do nothing but #define PAGE_COPY_THRESHOLD 0. Can't we just get rid of pagecopy.h? All it will do is result in a arch-specific copy of memcopy.h instead of pagecopy.h. We can use the same #undef ... #define method we used for MEMCPY_OK_FOR_FWD_MEMMOVE in the arch-specific header.. Siddhesh
Generally memcopy.h is machine-specific while pagecopy.h is OS-specific. Any scheme is OK with me if it follows typo-proof principles and means that an OS-specific header can use #include_next and #undef+#define to get all the rights bits without any source code duplication.
diff --git a/sysdeps/generic/pagecopy.h b/sysdeps/generic/pagecopy.h index 2c35b71..2862270 100644 --- a/sysdeps/generic/pagecopy.h +++ b/sysdeps/generic/pagecopy.h @@ -39,7 +39,7 @@ */ -#if PAGE_COPY_THRESHOLD +#if defined PAGE_COPY_THRESHOLD && PAGE_COPY_THRESHOLD #include <assert.h>