public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Jeff Law <law@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] gcc/doc: list what version each attribute was introduced in
Date: Fri, 07 Jul 2017 19:33:00 -0000	[thread overview]
Message-ID: <F00E7DAC-8236-4912-B9EB-43834BC8292D@comcast.net> (raw)
In-Reply-To: <81cbdb30-0e18-0079-6cad-d781cf332bdf@redhat.com>

On Jul 7, 2017, at 10:01 AM, Jeff Law <law@redhat.com> wrote:
> 
> On 07/06/2017 07:25 AM, Daniel P. Berrange wrote:
>> There are several hundred named attribute keys that have been
>> introduced over many GCC releases. Applications typically need
>> to be compilable with multiple GCC versions, so it is important
>> for developers to know when GCC introduced support for each
>> attribute.

> Keying on version #s is generally a terrible way to make your code
> portable.

> It's far better to actually *test* what your particular compiler
> compiler supports

So, if someone wanted to explore ways to make code that uses these better; a possibility might be to use __has_builtin a la clang:

  https://clang.llvm.org/docs/LanguageExtensions.html

It also has __has_feature and __has_extension.  At least it seems reasonably complete, and then people can feature test specific bits on a fine grained basis.

It doesn't solve history (without a re-release of old versions), but, it can provide a framework for solving the problem for the future.

  reply	other threads:[~2017-07-07 19:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 13:25 Daniel P. Berrange
2017-07-07 17:01 ` Jeff Law
2017-07-07 19:33   ` Mike Stump [this message]
2017-07-10  8:00   ` Daniel P. Berrange
2017-07-13 20:25   ` Eric Gallager
2017-07-12 15:24 ` Sandra Loosemore
2017-07-17 17:16 ` Martin Sebor

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=F00E7DAC-8236-4912-B9EB-43834BC8292D@comcast.net \
    --to=mikestump@comcast.net \
    --cc=berrange@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /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).