Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756031AbaFRU6b (ORCPT ); Wed, 18 Jun 2014 16:58:31 -0400 Received: from mail-qg0-f41.google.com ([209.85.192.41]:53901 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755380AbaFRU63 (ORCPT ); Wed, 18 Jun 2014 16:58:29 -0400 From: Paul Moore To: Geert Uytterhoeven Cc: Gideon Israel Dsouza , sds@tycho.nsa.gov, Eric Paris , Andrew Morton , linux-security-module@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/1] security: Used macros from compiler.h instead of __attribute__((...)) Date: Wed, 18 Jun 2014 16:58:25 -0400 Message-ID: <1772413.506pXYt1XL@sifl> User-Agent: KMail/4.13.2 (Linux/3.14.5-gentoo; KDE/4.13.2; x86_64; ; ) In-Reply-To: References: <1402502130-26400-1-git-send-email-gidisrael@gmail.com> <3604441.fZpjWNppGq@sifl> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, June 18, 2014 10:08:13 PM Geert Uytterhoeven wrote: > On Wed, Jun 18, 2014 at 8:50 PM, Paul Moore wrote: > > On Wednesday, June 11, 2014 09:25:30 PM Gideon Israel Dsouza wrote: > >> To increase compiler portability there is which > >> provides convenience macros for various gcc constructs. Eg: __packed > >> for __attribute__((packed)). > >> > >> This patch is part of a large task I've taken to clean the gcc > >> specific attributes and use the the macros instead. > >> > >> Signed-off-by: Gideon Israel Dsouza > >> --- > >> > >> security/selinux/include/security.h | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > > > > From what I can tell this should still work with both the LLVM and Intel > > compilers, is that correct? > > That's the idea of the compiler-agnostic attribute macros. I just wanted to make sure as I personally only really use gcc and don't pretend to be up on all the details regarding other compilers. > Interestingly, only include/linux/compiler-gcc.h defines __packed. >From what I could tell by looking at the code, the other compilers all define __GNUC__ so they get the __packed macro as part of the gcc configuration. I believe the LLVM and Intel compilers would only need to redefine __packed if they wanted/needed a different definition. > As it's already in heavy use, I can only assume both LLVM and the Intel > compilers handle both "__packed" (without a special definition) and the > gcc-specific "__attribute__((packed))". Yep, seems reasonable. I'll go ahead and apply the patch. -- paul moore www.paul-moore.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/