All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Gideon Israel Dsouza <gidisrael@gmail.com>,
	sds@tycho.nsa.gov, Eric Paris <eparis@parisplace.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-security-module@vger.kernel.org,
	"linux-kernel@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	[thread overview]
Message-ID: <1772413.506pXYt1XL@sifl> (raw)
In-Reply-To: <CAMuHMdVJ7zv0qqhZNMNXihm4Kqv9WA9yyMe3F9ptUZyDjvEnTg@mail.gmail.com>

On Wednesday, June 18, 2014 10:08:13 PM Geert Uytterhoeven wrote:
> On Wed, Jun 18, 2014 at 8:50 PM, Paul Moore <paul@paul-moore.com> wrote:
> > On Wednesday, June 11, 2014 09:25:30 PM Gideon Israel Dsouza wrote:
> >> To increase compiler portability there is <linux/compiler.h> 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 <gidisrael@gmail.com>
> >> ---
> >> 
> >>  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


  reply	other threads:[~2014-06-18 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 15:55 [PATCH] security: Use macros from compiler.h instead of gcc specific attributes Gideon Israel Dsouza
2014-06-11 15:55 ` [PATCH 1/1] security: Used macros from compiler.h instead of __attribute__((...)) Gideon Israel Dsouza
2014-06-18 18:50   ` Paul Moore
2014-06-18 20:08     ` Geert Uytterhoeven
2014-06-18 20:58       ` Paul Moore [this message]
2014-06-26 11:45         ` Gideon D'souza

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=1772413.506pXYt1XL@sifl \
    --to=paul@paul-moore.com \
    --cc=akpm@linux-foundation.org \
    --cc=eparis@parisplace.org \
    --cc=geert@linux-m68k.org \
    --cc=gidisrael@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.