All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai-git@xenomai.org, xenomai@xenomai.org
Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : alchemy: Replace static variable no_alchemy_task with macro
Date: Tue, 04 Feb 2014 18:31:08 +0100	[thread overview]
Message-ID: <52F123DC.1010307@xenomai.org> (raw)
In-Reply-To: <52F11F94.9000309@siemens.com>

On 02/04/2014 06:12 PM, Jan Kiszka wrote:
> On 2014-02-04 17:36, Philippe Gerum wrote:
>> On 02/04/2014 04:18 PM, git repository hosting wrote:
>>> Module: xenomai-jki
>>> Branch: for-forge
>>> Commit: bffcc58ed0114985a4d8d8a4cff2adff1b13292d
>>> URL:
>>> http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=bffcc58ed0114985a4d8d8a4cff2adff1b13292d
>>>
>>>
>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>> Date:   Tue Feb  4 16:12:07 2014 +0100
>>>
>>> alchemy: Replace static variable no_alchemy_task with macro
>>>
>>> The current definition of a static const variable representing an
>>> invalid alchemy task is both C++-incompatible and also ugly as we do not
>>> use them in every module that includes task.h. So replace it with a
>>> macro that builds the required struct on-the-fly.
>>
>> Could you elaborate on the ugly part of things? I don't really get your
>> point.
>
> It is ugly to define potentially unused static variables in a header,
> even more when this header is part of the public interface, pulled in by
> our users with hard to predict compiler configurations. But more
> important is the conflict with C++ (including C++11).

Are you sure you are using a C++ compiler recent enough?

Using g++ 4.7, I do not get any warning compiling the following code:

#include <stdio.h>
#include <stdlib.h>

struct x {
	unsigned a;
	unsigned b;
} y = {
	.a = 42,
	.b = 43,
};

int main(void)
{
	printf("%u\n", y.a);
}

Without even passing a -std option.


-- 
					    Gilles.


  parent reply	other threads:[~2014-02-04 17:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1WAhle-0006kB-0q@sd-51317.dedibox.fr>
2014-02-04 15:22 ` [Xenomai] [Xenomai-git] Jan Kiszka : alchemy: Replace static variable no_alchemy_task with macro Gilles Chanteperdrix
2014-02-04 16:36 ` Philippe Gerum
2014-02-04 17:12   ` Jan Kiszka
2014-02-04 17:27     ` Philippe Gerum
2014-02-04 17:32       ` Gilles Chanteperdrix
2014-02-04 17:35         ` Jan Kiszka
2014-02-04 17:39           ` Gilles Chanteperdrix
2014-02-04 17:39         ` Philippe Gerum
2014-02-04 17:44           ` Gilles Chanteperdrix
2014-02-04 17:46             ` Jan Kiszka
2014-02-04 17:48             ` Philippe Gerum
2014-02-04 17:53               ` Philippe Gerum
2014-02-04 18:03                 ` Jan Kiszka
2014-02-04 18:20                   ` Jan Kiszka
2014-02-04 18:26                     ` Gilles Chanteperdrix
2014-02-04 18:35                       ` Jan Kiszka
2014-02-05  9:07                         ` Philippe Gerum
2014-02-05  8:33                   ` Philippe Gerum
2014-02-05  8:49                     ` Jan Kiszka
2014-02-05  8:58                       ` Philippe Gerum
2014-02-05  9:06                         ` Jan Kiszka
2014-02-05  9:36                           ` Philippe Gerum
2014-02-05  9:42                             ` Jan Kiszka
2014-02-05 10:10                               ` Philippe Gerum
2014-02-05 10:28                                 ` Jan Kiszka
2014-02-06 15:24                                   ` Jan Kiszka
2014-02-05  7:30               ` dietmar.schindler
2014-02-04 17:31     ` Gilles Chanteperdrix [this message]
2014-02-04 17:35       ` Philippe Gerum

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=52F123DC.1010307@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai-git@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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.