From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20988 invoked by alias); 10 Nov 2016 18:07:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 20965 invoked by uid 89); 10 Nov 2016 18:07:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 10 Nov 2016 18:07:00 -0000 From: Joseph Myers To: Adhemerval Zanella CC: Subject: Re: [PATCH] Fix sh4 build with __ASSUME_ST_INO_64_BIT redefinition In-Reply-To: <1478695312-5009-1-git-send-email-adhemerval.zanella@linaro.org> Message-ID: References: <1478695312-5009-1-git-send-email-adhemerval.zanella@linaro.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-11/txt/msg00413.txt.bz2 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