public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Fix sh4 build with __ASSUME_ST_INO_64_BIT redefinition
Date: Thu, 10 Nov 2016 18:07:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1611101759240.26763@digraph.polyomino.org.uk> (raw)
In-Reply-To: <1478695312-5009-1-git-send-email-adhemerval.zanella@linaro.org>

On Wed, 9 Nov 2016, Adhemerval Zanella wrote:

> It is because sh4 kernel-features.sh is included multiple times
> without guards and this patch fixes by adding them. Tested on a
> sh4-linux-gnu build.
> 
> Also with this issues, is there are strong reason to *not* have include guards
> on kernel-features.h?  With current approach, a architecture can't include
> Linux default kernel-features.h and redefine it to a different value, only
> undefine it (unless it explicit do not include default kernel-features.h,
> and I think that's is not the idea).
> 
> 	* sysdeps/unix/sysv/linux/sh/kernel-features.h: Add include
> 	guards.

OK.  I think it's appropriate for all these headers to have include 
guards.

The #ifndef, #undef etc. could be avoided (moving this header closer to 
glibc's macro-name-typo-proof norms in this regard) if the header were 
split up into smaller pieces for individual macros or groups of related 
macros whenever a macro's definition needs to vary between architectures.  
Thus, you'd have e.g. kernel-features-st-ino.h defining 
__ASSUME_ST_INO_64_BIT to either 0 or 1, the default version of that 
header would define to 0 and the architectures overriding it would define 
to 1 (and wouldn't need #include_next).  kernel-features.h could end up as 
an architecture-independent header that just #includes the smaller 
architecture-specific headers.  (This is not a full design, especially for 
the more complicated cases such as socket syscalls.)

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2016-11-10 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 12:42 Adhemerval Zanella
2016-11-10 18:07 ` Joseph Myers [this message]
2016-11-10 20:02   ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1611101759240.26763@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).