lkml.org 
[lkml]   [2012]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] menuconfig: Replace CIRCLEQ by list_head-style lists.
Date
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. |
'------------------------------^-------^------------------^--------------------'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-10-21 00:41    [W:0.118 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site