public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org
Cc: Benjamin Poirier <benjamin.poirier@gmail.com>,
	Michal Marek <mmarek@suse.cz>, Jean Sacren <sakiwit@gmail.com>,
	Arnaud Lacombe <lacombar@gmail.com>,
	Wang YanQing <udknight@gmail.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Davidlohr Bueso <dave@gnu.org>,
	linux-kernel@vger.kernel.org,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Yaakov Selkowitz <yselkowitz@gmail.com>
Subject: Re: [PATCH] menuconfig: Replace CIRCLEQ by list_head-style lists.
Date: Sun, 21 Oct 2012 00:19:03 +0200	[thread overview]
Message-ID: <201210210019.04263.yann.morin.1998@free.fr> (raw)
In-Reply-To: <1350755792-21217-1-git-send-email-benjamin.poirier@gmail.com>

Benjamin, All,

On Saturday 20 October 2012 Benjamin Poirier wrote:
> From: Benjamin Poirier <bpoirier@suse.de>
> 
> sys/queue.h and CIRCLEQ in particular have proven to cause portability
> problems (reported on Debian Sarge, Cygwin and FreeBSD)
> 
> Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Benjamin Poirier <bpoirier@suse.de>

Sorry for my earlier optimistic reply, but...

While menuconfig got fixed with this patch, xconfig is now broken:

First issue:
In file included from /home/ymorin/dev/linux/scripts/kconfig/expr.h:15,
                 from /home/ymorin/dev/linux/scripts/kconfig/lkc.h:9,
                 from /home/ymorin/dev/linux/scripts/kconfig/qconf.cc:45:
/home/ymorin/dev/linux/scripts/kconfig/list.h:8:1: warning: "offsetof"
redefined
In file included from /usr/include/_G_config.h:15,
                 from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:75,
                 from /usr/include/qt4/QtCore/qtextstream.h:57,
                 from /usr/include/qt4/Qt3Support/q3mainwindow.h:47,
                 from /home/ymorin/dev/linux/scripts/kconfig/qconf.cc:19:
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h:411:1: warning: this
is the location of the previous definition

[--SNIP--]
> diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
> new file mode 100644
> index 0000000..934bdba
> --- /dev/null
> +++ b/scripts/kconfig/list.h
> @@ -0,0 +1,90 @@
> +#ifndef LIST_H
> +#define LIST_H
> +
> +/*
> + * Copied from include/linux/...
> + */
> +
> +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

We could #include <stddef.h>, but then we may end up with issues with
old systems (which we are trying to fix!). I suggest we enclose the
definition between a 
    #ifndef offsetof
    ...
    #endif


Second issue:
We have further issues with some variable names:
/home/ymorin/dev/linux/scripts/kconfig/list.h:69: error: expected ‘,’ or
‘...’ before ‘new’

[--SNIP--]
> +static inline void __list_add(struct list_head *new,

'new' is a reserved key-word in C++, and xconfig is using qconf, which is
written in C++.

I 'd suggest to:
 1- rename the variable
 2- enclose the whole header in:
    #ifdef __cplusplus
    extern "C" {
    #endif
    [.....]
    #ifdef __cplusplus
    }
    #endif

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2012-10-20 22:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18 17:33 [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Yann E. MORIN
2012-10-18 17:55 ` Yaakov (Cygwin/X)
2012-10-18 18:59   ` Yann E. MORIN
2012-10-19  8:59     ` Yaakov (Cygwin/X)
2012-10-19 12:10 ` Tetsuo Handa
2012-10-19 14:54   ` Michal Marek
2012-10-20 14:43     ` Tetsuo Handa
2012-10-20 16:58       ` Yann E. MORIN
2012-10-19 22:52   ` Yann E. MORIN
2012-10-20 17:56 ` [PATCH] menuconfig: Replace CIRCLEQ by list_head-style lists Benjamin Poirier
2012-10-20 21:22   ` Yann E. MORIN
2012-10-21  1:21     ` Tetsuo Handa
2012-10-20 22:19   ` Yann E. MORIN [this message]
2012-10-21  1:54   ` Yaakov (Cygwin/X)
2012-10-23 13:12 ` [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Christoph Hellwig
2012-10-23 17:04   ` Yann E. MORIN

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=201210210019.04263.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=benjamin.poirier@gmail.com \
    --cc=dave@gnu.org \
    --cc=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=paul.gortmaker@windriver.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sakiwit@gmail.com \
    --cc=udknight@gmail.com \
    --cc=yselkowitz@gmail.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