This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] BZ#13743: PowerPC - Add a new header for platformspecific functions
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, ryan dot arnold at gmail dot com, libc-alpha at sourceware dot org, sjmunroe at us dot ibm dot com
- Date: Tue, 6 Mar 2012 15:04:43 -0500
- Subject: Re: [PATCH 1/2] BZ#13743: PowerPC - Add a new header for platformspecific functions
- Authentication-results: mr.google.com; spf=pass (google.com: domain of patofiero@gmail.com designates 10.236.79.195 as permitted sender) smtp.mail=patofiero@gmail.com; dkim=pass header.i=patofiero@gmail.com
- References: <20120224164824.GB3455@linux.vnet.ibm.com><1331042262-25221-1-git-send-email-tuliom@linux.vnet.ibm.com><CADZpyix82sHSd-JDFUxd8PVHpXbjFG_2=iy2UZhFb8iz_C8rNA@mail.gmail.com><20120306172548.951272C08D@topped-with-meat.com>
On Tue, Mar 6, 2012 at 12:25 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> I would like to see sys/platform.h become the place for non-standard
>> low-level macros.
>
> The standard place for nonstandard interfaces. ?Sure, buddy. ?Whatever.
> Given that they are entirely nonstandard anyway, I'm not sure it makes
> much difference whether they are in some generic-sounding header like
> this or in headers with more specific names.
Roland, thanks for your feedback. I can always count on you to
play the devil's advocate :-)
I see nothing wrong with the suggestion, but you are correct
technically any name would do. However, users already come trained
with expectations that sys/platform.h provides non-standard
low-level macros and there is value in matching expectations.
> I'm solidly ambivalent about the utility of a catch-all header for
> random things. ?I'd say the fact that other systems use this file name
> is between meaningless and negative as a recommendation to use it for
> something that isn't even trying to be compatible with any other system.
I mentioned the other systems, not for the sake of compatibility,
but simply to point out prior-art for a similar solution.
> In the absence of any common interface (which could even be just one
> other system whose header name and interface we match, as we have done
> before), there is some logic in using individual headers with names as
> specific as possible (e.g. <ppc-timebase.h> here). ?That makes it much
> clearer for applications to include exactly what they use.
That's a very good suggestion, but in my opinion it complicates
things needlessly. That's not to say that I don't like the
solution, I like it *better* than sys/platform.h, but
we should think about users too and what the interface looks
like to them.
It's easier to explain to users that there is one header that
has non-standard low-level bits, it's easier to document, and
it matches pre-existing expectations from other OSs.
All together it makes sys/platform.h a better solution.
Given that you bring no strong argument against a catch-all
header I'm going to go forward with accepting IBM's patch
for this support.
Cheers,
Carlos.