This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Fix Wundef warning for MEMCPY_OK_FOR_FWD_MEMMOVE
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Will Newton <will dot newton at linaro dot org>, libc-alpha <libc-alpha at sourceware dot org>, Chris Metcalf <cmetcalf at tilera dot com>
- Date: Fri, 27 Jun 2014 13:00:40 -0700 (PDT)
- Subject: Re: [PATCH v2] Fix Wundef warning for MEMCPY_OK_FOR_FWD_MEMMOVE
- Authentication-results: sourceware.org; auth=none
- References: <20140626185412 dot GA1826 at spoyarek dot pnq dot redhat dot com> <20140626190423 dot 572732C3993 at topped-with-meat dot com> <20140627092109 dot GD4477 at spoyarek dot pnq dot redhat dot com> <CANu=Dmi2W9jK8+jjtSms3Y0KTuY20UnvLTz_0iTOOYnedT0uzg at mail dot gmail dot com> <20140627171326 dot GE4477 at spoyarek dot pnq dot redhat dot com> <20140627173056 dot GF4477 at spoyarek dot pnq dot redhat dot com>
> On Thu, Jun 26, 2014 at 12:04:23PM -0700, Roland McGrath wrote:
> > That only helps x86_64 and not anybody else using that file (whether
> > directly by sysdeps selection or by #include). I think memcopy.h should
> > be required to define that one way or the other. Then we can have a
> > default in sysdeps/generic/memcopy.h.
>
> Wouldn't that not catch cases where one forgets to define the macro
> and inherits the default?
The norm is not to define it and use the default. It's not an error to be
caught. Anyone who does not want the default (today, only tile) would
include the generic header before overriding a subset of its definitions
(as tile does). So tile would just do:
#undef MEMCPY_OK_FOR_FWD_MEMMOVE
#define MEMCPY_OK_FOR_FWD_MEMMOVE 1