All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [PATCH] boilerplate/avl: fix missing include
@ 2018-10-18 12:20 Sebastian Smolorz
  2018-10-18 12:37 ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-18 12:20 UTC (permalink / raw)
  To: xenomai

Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
---
 lib/boilerplate/avl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/boilerplate/avl.c b/lib/boilerplate/avl.c
index 3bf9bf1..2e16e7d 100644
--- a/lib/boilerplate/avl.c
+++ b/lib/boilerplate/avl.c
@@ -22,6 +22,7 @@
  */
 #include <errno.h>
 #include <memory.h>
+#include <boilerplate/avl.h>
 
 #ifdef AVL_PSHARED
 #define __AVL(__decl)	shavl_ ## __decl
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-18 12:20 [Xenomai] [PATCH] boilerplate/avl: fix missing include Sebastian Smolorz
@ 2018-10-18 12:37 ` Philippe Gerum
  2018-10-18 14:37   ` Sebastian Smolorz
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Gerum @ 2018-10-18 12:37 UTC (permalink / raw)
  To: Sebastian Smolorz, xenomai

On 10/18/2018 02:20 PM, Sebastian Smolorz wrote:
> Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
> ---
>  lib/boilerplate/avl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/boilerplate/avl.c b/lib/boilerplate/avl.c
> index 3bf9bf1..2e16e7d 100644
> --- a/lib/boilerplate/avl.c
> +++ b/lib/boilerplate/avl.c
> @@ -22,6 +22,7 @@
>   */
>  #include <errno.h>
>  #include <memory.h>
> +#include <boilerplate/avl.h>
>  
>  #ifdef AVL_PSHARED
>  #define __AVL(__decl)	shavl_ ## __decl
> 

Nack. The proper include file needs to be included via some Makefile
magic, depending on whether that source is build for private or shared
mode (avl.h vs shavl.h). See Makefile.am.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-18 12:37 ` Philippe Gerum
@ 2018-10-18 14:37   ` Sebastian Smolorz
  2018-10-19  7:16     ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-18 14:37 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On 18.10.18 14:37, Philippe Gerum wrote:

> On 10/18/2018 02:20 PM, Sebastian Smolorz wrote:
> > Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
> > ---
> >  lib/boilerplate/avl.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/lib/boilerplate/avl.c b/lib/boilerplate/avl.c
> > index 3bf9bf1..2e16e7d 100644
> > --- a/lib/boilerplate/avl.c
> > +++ b/lib/boilerplate/avl.c
> > @@ -22,6 +22,7 @@
> >   */
> >  #include <errno.h>
> >  #include <memory.h>
> > +#include <boilerplate/avl.h>
> >  
> >  #ifdef AVL_PSHARED
> >  #define __AVL(__decl)	shavl_ ## __decl
> > 
> 
> Nack. The proper include file needs to be included via some Makefile
> magic, depending on whether that source is build for private or shared
> mode (avl.h vs shavl.h). See Makefile.am.

Sorry for the noise, it was my fault. I was hunting another bug which
included switching gcc versions and jumping back and forth in
the git history. At some point I just forgot to execute scripts/bootstrap
and fooled myself with wrong Makefiles.

Nevertheless, I guess there is an issue with the definition of const (line 50) in
include/boilerplate/compiler.h. It does work with gcc 5.4 but not with
gcc 4.3.5.

-- 
Sebastian


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-18 14:37   ` Sebastian Smolorz
@ 2018-10-19  7:16     ` Philippe Gerum
  2018-10-19  9:56       ` Sebastian Smolorz
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Gerum @ 2018-10-19  7:16 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
> 
> Nevertheless, I guess there is an issue with the definition of const (line 50) in
> include/boilerplate/compiler.h. It does work with gcc 5.4 but not with
> gcc 4.3.5.
> 

Could you elaborate on this? Which error pops us, in which context?

Thanks,

-- 
Philippe.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-19  7:16     ` Philippe Gerum
@ 2018-10-19  9:56       ` Sebastian Smolorz
  2018-10-19 15:10         ` Sebastian Smolorz
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-19  9:56 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On 10/19/2018 09:16 AM, Philippe Gerum wrote:
> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
> > Nevertheless, I guess there is an issue with the definition of const
> > (line 50) in include/boilerplate/compiler.h. It does work with gcc
> > 5.4 but not with gcc 4.3.5.
> 
> Could you elaborate on this? Which error pops us, in which context?

Compilation of libboilerplate and libiniparser (master and next) fails 
with a cross gcc 4.3.5 for x86_32 (i586) targets. If I change the line 
mentioned above into

#define __const const

the error does not pop up any more. Works also when I completely remove 
the #define __const.

-- 
Sebastian





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-19  9:56       ` Sebastian Smolorz
@ 2018-10-19 15:10         ` Sebastian Smolorz
  2018-10-23  9:11           ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-19 15:10 UTC (permalink / raw)
  To: xenomai

Hello Philippe,

Sebastian Smolorz wrote:
> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
> > On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
> > > Nevertheless, I guess there is an issue with the definition of
> > > const
> > > (line 50) in include/boilerplate/compiler.h. It does work with gcc
> > > 5.4 but not with gcc 4.3.5.
> > 
> > Could you elaborate on this? Which error pops us, in which context?
> 
> Compilation of libboilerplate and libiniparser (master and next) fails
> with a cross gcc 4.3.5 for x86_32 (i586) targets. If I change the
> line mentioned above into
> 
> #define __const const
> 
> the error does not pop up any more. Works also when I completely
> remove the #define __const.

I've found two additional compile errors due to the usage of ancient gcc 
and glibc. I could prepare patches for that. But I'm not sure how to fix 
this __const issue properly. I've seen that you introduced those lines 
in commit  5632adb8 into -next. I suppose you faced an issue which 
needed this fix, am I correct?

Thanks,

-- 
Sebastian




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-19 15:10         ` Sebastian Smolorz
@ 2018-10-23  9:11           ` Philippe Gerum
  2018-10-24 10:33             ` Sebastian Smolorz
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Gerum @ 2018-10-23  9:11 UTC (permalink / raw)
  To: Sebastian Smolorz, xenomai

On 10/19/18 5:10 PM, Sebastian Smolorz wrote:
> Hello Philippe,
> 
> Sebastian Smolorz wrote:
>> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
>>> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
>>>> Nevertheless, I guess there is an issue with the definition of
>>>> const
>>>> (line 50) in include/boilerplate/compiler.h. It does work with gcc
>>>> 5.4 but not with gcc 4.3.5.
>>>
>>> Could you elaborate on this? Which error pops us, in which context?
>>
>> Compilation of libboilerplate and libiniparser (master and next) fails
>> with a cross gcc 4.3.5 for x86_32 (i586) targets. If I change the
>> line mentioned above into
>>
>> #define __const const
>>
>> the error does not pop up any more. Works also when I completely
>> remove the #define __const.
> 
> I've found two additional compile errors due to the usage of ancient gcc 
> and glibc. I could prepare patches for that. But I'm not sure how to fix 
> this __const issue properly. I've seen that you introduced those lines 
> in commit  5632adb8 into -next. I suppose you faced an issue which 
> needed this fix, am I correct?
> 

Adding constness to a function was needed at some point, __const was
meant to be a shorthand for annotating the code. You did not provide the
error message received from gcc 4.3 so I can't be sure, however the
following change might fix the issue:

diff --git a/include/boilerplate/compiler.h b/include/boilerplate/compiler.h
index f526eb269..469d0c249 100644
--- a/include/boilerplate/compiler.h
+++ b/include/boilerplate/compiler.h
@@ -47,7 +47,7 @@
 #endif

 #ifndef __const
-#define __const		__attribute__((__const__))
+#define __const		__attribute__((const))
 #endif

 #ifndef __pure

-- 
Philippe.


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-23  9:11           ` Philippe Gerum
@ 2018-10-24 10:33             ` Sebastian Smolorz
  2018-10-24 10:47               ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-24 10:33 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On 10/23/18 11:11 AM, Philippe Gerum wrote:
> On 10/19/18 5:10 PM, Sebastian Smolorz wrote:
> > Hello Philippe,
> > 
> > Sebastian Smolorz wrote:
> >> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
> >>> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
> >>>> Nevertheless, I guess there is an issue with the definition of
> >>>> const
> >>>> (line 50) in include/boilerplate/compiler.h. It does work with
> >>>> gcc
> >>>> 5.4 but not with gcc 4.3.5.
> >>> 
> >>> Could you elaborate on this? Which error pops us, in which
> >>> context?
> >> 
> >> Compilation of libboilerplate and libiniparser (master and next)
> >> fails with a cross gcc 4.3.5 for x86_32 (i586) targets. If I
> >> change the line mentioned above into
> >> 
> >> #define __const const
> >> 
> >> the error does not pop up any more. Works also when I completely
> >> remove the #define __const.
> > 
> > I've found two additional compile errors due to the usage of ancient
> > gcc and glibc. I could prepare patches for that. But I'm not sure
> > how to fix this __const issue properly. I've seen that you
> > introduced those lines in commit  5632adb8 into -next. I suppose
> > you faced an issue which needed this fix, am I correct?
> 
> Adding constness to a function was needed at some point, __const was
> meant to be a shorthand for annotating the code. You did not provide
> the error message received from gcc 4.3 so I can't be sure, however
> the following change might fix the issue:
> 
> diff --git a/include/boilerplate/compiler.h
> b/include/boilerplate/compiler.h index f526eb269..469d0c249 100644
> --- a/include/boilerplate/compiler.h
> +++ b/include/boilerplate/compiler.h
> @@ -47,7 +47,7 @@
>  #endif
> 
>  #ifndef __const
> -#define __const		__attribute__((__const__))
> +#define __const		__attribute__((const))
>  #endif
> 
>  #ifndef __pure

That does not change the error. The condensed error output is:

  CC       libboilerplate_la-ancillaries.lo
cc1: warnings being treated as errors
lib/boilerplate/iniparser/dictionary.c: In function 'xstrdup':
lib/boilerplate/iniparser/dictionary.c:72: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c:74: error: passing argument 2 of 
'strcpy' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c: In function 'dictionary_hash':
lib/boilerplate/iniparser/dictionary.c:100: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c: In function 'dictionary_get':
lib/boilerplate/iniparser/dictionary.c:193: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c:193: error: 'const' attribute 
ignored
lib/boilerplate/iniparser/dictionary.c:193: error: 'const' attribute 
does not apply to types
lib/boilerplate/iniparser/dictionary.c: In function 'dictionary_set':
lib/boilerplate/iniparser/dictionary.c:242: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c:242: error: 'const' attribute 
ignored
lib/boilerplate/iniparser/dictionary.c:242: error: 'const' attribute 
does not apply to types
lib/boilerplate/iniparser/dictionary.c: In function 'dictionary_unset':
lib/boilerplate/iniparser/dictionary.c:311: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/dictionary.c:311: error: 'const' attribute 
ignored
lib/boilerplate/iniparser/dictionary.c:311: error: 'const' attribute 
does not apply to types

cc1: warnings being treated as errors
lib/boilerplate/iniparser/iniparser.c: In function 'strstrip':
lib/boilerplate/iniparser/iniparser.c:92: error: passing argument 2 of 
'strcpy' discards qualifiers from pointer target type
lib/boilerplate/iniparser/iniparser.c: In function 'iniparser_dump_ini':
lib/boilerplate/iniparser/iniparser.c:237: error: passing argument 1 of 
'strlen' discards qualifiers from pointer target type
lib/boilerplate/iniparser/iniparser.c:243: error: 'const' attribute 
ignored
lib/boilerplate/iniparser/iniparser.c:243: error: 'const' attribute does 
not apply to types
lib/boilerplate/iniparser/iniparser.c: In function 'iniparser_getint':
lib/boilerplate/iniparser/iniparser.c:314: error: passing argument 1 of 
'strtol' discards qualifiers from pointer target type
lib/boilerplate/iniparser/iniparser.c: In function 
'iniparser_getdouble':
lib/boilerplate/iniparser/iniparser.c:336: error: passing argument 1 of 
'atof' discards qualifiers from pointer target type
lib/boilerplate/iniparser/iniparser.c: In function 'iniparser_line':
lib/boilerplate/iniparser/iniparser.c:492: error: 'const' attribute 
ignored
lib/boilerplate/iniparser/iniparser.c:492: error: 'const' attribute does 
not apply to types
In file included from lib/boilerplate/ancillaries.c:27:
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:82: error: expected ')' before '__attribute__'
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:82: error: expected ',' or ';' before ')' token
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:84: error: expected ')' before '__attribute__'
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:84: error: expected ',' or ';' before ')' token
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:86: error: expected ')' before '__attribute__'
i586-nptl-linux-gnu/bin/../i586-nptl-linux-gnu/sys-root/usr/include/
ctype.h:86: error: expected ',' or ';' before ')' token

cc1: warnings being treated as errors
lib/boilerplate/ancillaries.c: In function 
'__get_online_cpus_from_proc':
lib/boilerplate/ancillaries.c:339: error: 'const' attribute ignored
lib/boilerplate/ancillaries.c:339: error: 'const' attribute does not 
apply to types
lib/boilerplate/ancillaries.c: In function 'get_online_cpu_set':
lib/boilerplate/ancillaries.c:373: error: 'const' attribute does not 
apply to types
lib/boilerplate/ancillaries.c: In function 'get_mem_size':
lib/boilerplate/ancillaries.c:492: error: passing argument 1 of 'strtol' 
discards qualifiers from pointer target type

Thanks,

-- 
Sebastian





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-24 10:33             ` Sebastian Smolorz
@ 2018-10-24 10:47               ` Philippe Gerum
  2018-10-24 10:58                 ` Sebastian Smolorz
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Gerum @ 2018-10-24 10:47 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

On 10/24/18 12:33 PM, Sebastian Smolorz wrote:
> On 10/23/18 11:11 AM, Philippe Gerum wrote:
>> On 10/19/18 5:10 PM, Sebastian Smolorz wrote:
>>> Hello Philippe,
>>>
>>> Sebastian Smolorz wrote:
>>>> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
>>>>> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
>>>>>> Nevertheless, I guess there is an issue with the definition of
>>>>>> const
>>>>>> (line 50) in include/boilerplate/compiler.h. It does work with
>>>>>> gcc
>>>>>> 5.4 but not with gcc 4.3.5.
>>>>>
>>>>> Could you elaborate on this? Which error pops us, in which
>>>>> context?
>>>>
>>>> Compilation of libboilerplate and libiniparser (master and next)
>>>> fails with a cross gcc 4.3.5 for x86_32 (i586) targets. If I
>>>> change the line mentioned above into
>>>>
>>>> #define __const const
>>>>
>>>> the error does not pop up any more. Works also when I completely
>>>> remove the #define __const.
>>>
>>> I've found two additional compile errors due to the usage of ancient
>>> gcc and glibc. I could prepare patches for that. But I'm not sure
>>> how to fix this __const issue properly. I've seen that you
>>> introduced those lines in commit  5632adb8 into -next. I suppose
>>> you faced an issue which needed this fix, am I correct?
>>
>> Adding constness to a function was needed at some point, __const was
>> meant to be a shorthand for annotating the code. You did not provide
>> the error message received from gcc 4.3 so I can't be sure, however
>> the following change might fix the issue:
>>
>> diff --git a/include/boilerplate/compiler.h
>> b/include/boilerplate/compiler.h index f526eb269..469d0c249 100644
>> --- a/include/boilerplate/compiler.h
>> +++ b/include/boilerplate/compiler.h
>> @@ -47,7 +47,7 @@
>>  #endif
>>
>>  #ifndef __const
>> -#define __const		__attribute__((__const__))
>> +#define __const		__attribute__((const))
>>  #endif
>>
>>  #ifndef __pure
> 
> That does not change the error. The condensed error output is:
> 
>   CC       libboilerplate_la-ancillaries.lo
> cc1: warnings being treated as errors
> lib/boilerplate/iniparser/dictionary.c: In function 'xstrdup':
> lib/boilerplate/iniparser/dictionary.c:72: error: passing argument 1 of 
> 'strlen' discards qualifiers from pointer target type
> lib/boilerplate/iniparser/dictionary.c:74: error: passing argument 2 of 

Ok, so this is a conflict with older libc headers defining their own
wrappers for the const qualifier; we have no in-tree users of __pure and
__const definitions anymore, so we should drop them, fixing the issue in
the same move.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-24 10:47               ` Philippe Gerum
@ 2018-10-24 10:58                 ` Sebastian Smolorz
  2018-10-24 14:53                   ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2018-10-24 10:58 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On 10/24/18 12:47 PM, Philippe Gerum wrote:
> On 10/24/18 12:33 PM, Sebastian Smolorz wrote:
> > On 10/23/18 11:11 AM, Philippe Gerum wrote:
> >> On 10/19/18 5:10 PM, Sebastian Smolorz wrote:
> >>> Hello Philippe,
> >>> 
> >>> Sebastian Smolorz wrote:
> >>>> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
> >>>>> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
> >>>>>> Nevertheless, I guess there is an issue with the definition of
> >>>>>> const
> >>>>>> (line 50) in include/boilerplate/compiler.h. It does work with
> >>>>>> gcc
> >>>>>> 5.4 but not with gcc 4.3.5.
> >>>>> 
> >>>>> Could you elaborate on this? Which error pops us, in which
> >>>>> context?
> >>>> 
> >>>> Compilation of libboilerplate and libiniparser (master and next)
> >>>> fails with a cross gcc 4.3.5 for x86_32 (i586) targets. If I
> >>>> change the line mentioned above into
> >>>> 
> >>>> #define __const const
> >>>> 
> >>>> the error does not pop up any more. Works also when I completely
> >>>> remove the #define __const.
> >>> 
> >>> I've found two additional compile errors due to the usage of
> >>> ancient
> >>> gcc and glibc. I could prepare patches for that. But I'm not sure
> >>> how to fix this __const issue properly. I've seen that you
> >>> introduced those lines in commit  5632adb8 into -next. I suppose
> >>> you faced an issue which needed this fix, am I correct?
> >> 
> >> Adding constness to a function was needed at some point, __const
> >> was
> >> meant to be a shorthand for annotating the code. You did not
> >> provide
> >> the error message received from gcc 4.3 so I can't be sure, however
> >> the following change might fix the issue:
> >> 
> >> diff --git a/include/boilerplate/compiler.h
> >> b/include/boilerplate/compiler.h index f526eb269..469d0c249 100644
> >> --- a/include/boilerplate/compiler.h
> >> +++ b/include/boilerplate/compiler.h
> >> @@ -47,7 +47,7 @@
> >> 
> >>  #endif
> >>  
> >>  #ifndef __const
> >> 
> >> -#define __const		__attribute__((__const__))
> >> +#define __const		__attribute__((const))
> >> 
> >>  #endif
> >>  
> >>  #ifndef __pure
> > 
> > That does not change the error. The condensed error output is:
> >   CC       libboilerplate_la-ancillaries.lo
> > 
> > cc1: warnings being treated as errors
> > lib/boilerplate/iniparser/dictionary.c: In function 'xstrdup':
> > lib/boilerplate/iniparser/dictionary.c:72: error: passing argument 1
> > of 'strlen' discards qualifiers from pointer target type
> > lib/boilerplate/iniparser/dictionary.c:74: error: passing argument 2
> > of
> Ok, so this is a conflict with older libc headers defining their own
> wrappers for the const qualifier; we have no in-tree users of __pure
> and __const definitions anymore, so we should drop them, fixing the
> issue in the same move.

Thanks. Will you send out a patch for this or should I do this?

-- 
Sebastian





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Xenomai] [PATCH] boilerplate/avl: fix missing include
  2018-10-24 10:58                 ` Sebastian Smolorz
@ 2018-10-24 14:53                   ` Philippe Gerum
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe Gerum @ 2018-10-24 14:53 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

On 10/24/18 12:58 PM, Sebastian Smolorz wrote:
> On 10/24/18 12:47 PM, Philippe Gerum wrote:
>> On 10/24/18 12:33 PM, Sebastian Smolorz wrote:
>>> On 10/23/18 11:11 AM, Philippe Gerum wrote:
>>>> On 10/19/18 5:10 PM, Sebastian Smolorz wrote:
>>>>> Hello Philippe,
>>>>>
>>>>> Sebastian Smolorz wrote:
>>>>>> On 10/19/2018 09:16 AM, Philippe Gerum wrote:
>>>>>>> On 10/18/2018 04:37 PM, Sebastian Smolorz wrote:
>>>>>>>> Nevertheless, I guess there is an issue with the definition of
>>>>>>>> const
>>>>>>>> (line 50) in include/boilerplate/compiler.h. It does work with
>>>>>>>> gcc
>>>>>>>> 5.4 but not with gcc 4.3.5.
>>>>>>>
>>>>>>> Could you elaborate on this? Which error pops us, in which
>>>>>>> context?
>>>>>>
>>>>>> Compilation of libboilerplate and libiniparser (master and next)
>>>>>> fails with a cross gcc 4.3.5 for x86_32 (i586) targets. If I
>>>>>> change the line mentioned above into
>>>>>>
>>>>>> #define __const const
>>>>>>
>>>>>> the error does not pop up any more. Works also when I completely
>>>>>> remove the #define __const.
>>>>>
>>>>> I've found two additional compile errors due to the usage of
>>>>> ancient
>>>>> gcc and glibc. I could prepare patches for that. But I'm not sure
>>>>> how to fix this __const issue properly. I've seen that you
>>>>> introduced those lines in commit  5632adb8 into -next. I suppose
>>>>> you faced an issue which needed this fix, am I correct?
>>>>
>>>> Adding constness to a function was needed at some point, __const
>>>> was
>>>> meant to be a shorthand for annotating the code. You did not
>>>> provide
>>>> the error message received from gcc 4.3 so I can't be sure, however
>>>> the following change might fix the issue:
>>>>
>>>> diff --git a/include/boilerplate/compiler.h
>>>> b/include/boilerplate/compiler.h index f526eb269..469d0c249 100644
>>>> --- a/include/boilerplate/compiler.h
>>>> +++ b/include/boilerplate/compiler.h
>>>> @@ -47,7 +47,7 @@
>>>>
>>>>  #endif
>>>>  
>>>>  #ifndef __const
>>>>
>>>> -#define __const		__attribute__((__const__))
>>>> +#define __const		__attribute__((const))
>>>>
>>>>  #endif
>>>>  
>>>>  #ifndef __pure
>>>
>>> That does not change the error. The condensed error output is:
>>>   CC       libboilerplate_la-ancillaries.lo
>>>
>>> cc1: warnings being treated as errors
>>> lib/boilerplate/iniparser/dictionary.c: In function 'xstrdup':
>>> lib/boilerplate/iniparser/dictionary.c:72: error: passing argument 1
>>> of 'strlen' discards qualifiers from pointer target type
>>> lib/boilerplate/iniparser/dictionary.c:74: error: passing argument 2
>>> of
>> Ok, so this is a conflict with older libc headers defining their own
>> wrappers for the const qualifier; we have no in-tree users of __pure
>> and __const definitions anymore, so we should drop them, fixing the
>> issue in the same move.
> 
> Thanks. Will you send out a patch for this or should I do this?
> 

I've queued one, thanks.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-10-24 14:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 12:20 [Xenomai] [PATCH] boilerplate/avl: fix missing include Sebastian Smolorz
2018-10-18 12:37 ` Philippe Gerum
2018-10-18 14:37   ` Sebastian Smolorz
2018-10-19  7:16     ` Philippe Gerum
2018-10-19  9:56       ` Sebastian Smolorz
2018-10-19 15:10         ` Sebastian Smolorz
2018-10-23  9:11           ` Philippe Gerum
2018-10-24 10:33             ` Sebastian Smolorz
2018-10-24 10:47               ` Philippe Gerum
2018-10-24 10:58                 ` Sebastian Smolorz
2018-10-24 14:53                   ` Philippe Gerum

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.