This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PowerPC: Define _STRING_ARCH_unaligned
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Fri, 21 Mar 2014 13:28:56 -0700 (PDT)
- Subject: Re: PowerPC: Define _STRING_ARCH_unaligned
- Authentication-results: sourceware.org; auth=none
- References: <532B32B2 dot 3020306 at linux dot vnet dot ibm dot com>
> Here is another warning fixing, powerpc specific. Following where it is
> defined for other archs, I had added a new header for PowerPC. I am not
> very found of adding another arch-specific header, however it seems the
> way to avoid such define issues.
We should not need a new header just for this. In this case, it seems
appropriate for the generic bits/string.h to provide the common default.
It looks like the most common value is 1, but I'm not entirely sure. We
should take a poll of all the architectures. If there are only a few that
want 0, then I'd say those few can add their own bits/string.h that defines
it that way even if they have nothing else to define. (For example today
sysdeps/m68k/m680x0/m68020/bits/string.h is nothing but setting it to 1.
So if 1 is the common default, that file would be removed and arm, ia64, et
al--whatever minority wants 0--would add files to set it to 0.)
If in fact there is not a big disparity between the number that want it set
to 0 but have no other bits/string.h content to provide and the number that
want it set to 1 but have no other bits/string.h content to provide, then
we should reconsider. In that sort of case it may well be most reasonable
(i.e. best overall for avoiding typo-prone code balanced with avoiding
duplicative code) to have string.h do #ifndef #define after including
bits/string.h.
Note that your patch is not just fixing the warning, it is changing the
behavior because the missing macro was interpreted as 0 before. So I think
we should treat this as two separate issues and possibly two separate
changes: -Wundef cleanup; and changing the powerpc setting.
Thanks,
Roland