All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.de.marchi@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-modules <linux-modules@vger.kernel.org>
Subject: Re: [PATCH kmod] shared/util.c: assert_cc() can only be used inside functions
Date: Mon, 5 Jun 2017 01:04:46 -0700	[thread overview]
Message-ID: <CAKi4VA+3azA-8pyNS0F73d_0ahCA7=n_opwnxp9A-2Y67oLe8w@mail.gmail.com> (raw)
In-Reply-To: <1496502202-9832-1-git-send-email-thomas.petazzoni@free-electrons.com>

On Sat, Jun 3, 2017 at 8:03 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> shared/macro.h has two versions of assert_cc, one that uses gcc
> _Static_assert(), which requires recent enough gcc versions, and one
> that uses a fake array to trigger a build error. The latter can only
> work inside functions, so assert_cc() should only be used inside
> functions.
>
> Fixes the following build failure when building kmod with old gcc
> versions such as gcc 4.3.x:
>
> shared/util.c:52: error: expected identifier or '(' before 'do'
> shared/util.c:52: error: expected identifier or '(' before 'while'
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---

The changes look simple, but going forward I'd like to understand
this. kmod requires C11 that contains _Static_assert().

Is there a compelling reason to support a compiler that old? GCC 4.3.0
has been released 9 years ago.

Lucas De Marchi

  reply	other threads:[~2017-06-05  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03 15:03 [PATCH kmod] shared/util.c: assert_cc() can only be used inside functions Thomas Petazzoni
2017-06-05  8:04 ` Lucas De Marchi [this message]
2017-06-05  8:22   ` Thomas Petazzoni
2017-06-05 17:06     ` Lucas De Marchi
2017-06-06  7:16       ` Thomas Petazzoni

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='CAKi4VA+3azA-8pyNS0F73d_0ahCA7=n_opwnxp9A-2Y67oLe8w@mail.gmail.com' \
    --to=lucas.de.marchi@gmail.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.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 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.