Skip to contentSkip to conversation

An error occures when installing Xenomai libraries and tools

DISCUSSION rany97 3 participants 7 messages Sep 9, 2021 – Sep 10, 2021 1 message not in the archive

lore
Share & tools
lore

rany97

author
#0 lore raw

Hi,

When I run "sudo make install" to install Xenomai libraries and tools, gcc reports an error posted below:
--------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c: In function ‘iniparser_load’:
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict]   616 |             sprintf(tmp, "%s:%s", section, key);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-------------------------------------------------------------------
Shall I ignore it?

-------------------------------------------------------------------
Some info lost in last mail:
gcc 10.2.1
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux Xenomai 3.1
-------------------------------------------------------------------

Thanks,
R.

#1 lore raw
Quoted 14 lines · On Thu, 2021-09-09 at 11:43 +0800, rany97 via Xenomai wrote:

Hi,

When I run "sudo make install" to install Xenomai libraries and tools, gcc reports an error posted below:
--------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c: In function ‘iniparser_load’:
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict]   616 |             sprintf(tmp, "%s:%s", section, key);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-------------------------------------------------------------------
Shall I ignore it?

Quoted 6 lines

-------------------------------------------------------------------
Some info lost in last mail:
gcc 10.2.1
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux Xenomai 3.1
-------------------------------------------------------------------

I have the same setup here, and there is no such warning. There is no sprintf in iniparser.c:616. Are you sure it's Xenomai 3.1 you're looking at?

Some time ago I had to update the iniparser (from its upstream source) to get rid of such compiler warnings.

Quoted 4 lines

Thanks,
R.

#2 lore raw
Quoted 22 lines · Florian via Xenomai
Quoted 14 lines · On Thu, 2021-09-09 at 11:43 +0800, rany97 via Xenomai wrote:

Hi,

When I run "sudo make install" to install Xenomai libraries and tools, gcc reports an error posted below:
--------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c: In function ‘iniparser_load’:
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict]   616 |             sprintf(tmp, "%s:%s", section, key);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-------------------------------------------------------------------
Shall I ignore it?

Quoted 6 lines

-------------------------------------------------------------------
Some info lost in last mail:
gcc 10.2.1
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux Xenomai 3.1
-------------------------------------------------------------------

Quoted 7 lines

I have the same setup here, and there is no such warning. There is no sprintf in iniparser.c:616. Are you sure it's Xenomai 3.1 you're looking at?

Some time ago I had to update the iniparser (from its upstream source) to get rid of such compiler warnings.

That fix was merged into master and stable/v3.1.x long ago. You just need to use the latest stable release.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 27 lines · Jan Kiszka
Quoted 26 lines · Florian via Xenomai
Quoted 14 lines · On Thu, 2021-09-09 at 11:43 +0800, rany97 via Xenomai wrote:

Hi,

When I run "sudo make install" to install Xenomai libraries and tools, gcc reports an error posted below:
--------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c: In function ‘iniparser_load’:
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict]   616 |             sprintf(tmp, "%s:%s", section, key);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-------------------------------------------------------------------
Shall I ignore it?

Quoted 6 lines

-------------------------------------------------------------------
Some info lost in last mail:
gcc 10.2.1
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux Xenomai 3.1
-------------------------------------------------------------------

I have the same setup here, and there is no such warning. There is no sprintf in iniparser.c:616. Are you sure it's Xenomai 3.1 you're looking at?

Quoted 6 lines
Quoted 3 lines

Some time ago I had to update the iniparser (from its upstream source) to get rid of such compiler warnings.

That fix was merged into master and stable/v3.1.x long ago. You just need to use the latest stable release.

Just noticed that the stable/3.0 branch still has this issue. So maybe it was about 3.0 and not 3.1?

@Jan
I noticed that 3.0 is broken when trying to update xenomai images to Debian 11. IOW: 3.0 is not buildable with Debian 11. Should we apply

8acdbd718b78 ("lib/boilerplate/iniparser: Allow building with GCC 10.2 2020101")

to stable/3.0 as well? It applies cleanly.

Quoted 3 lines

Jan

#4 lore raw
Quoted 38 lines · Florian (T RDA IOT SES-DE)
Quoted 27 lines · Jan Kiszka
Quoted 26 lines · Florian via Xenomai
Quoted 14 lines · On Thu, 2021-09-09 at 11:43 +0800, rany97 via Xenomai wrote:

Hi,

When I run "sudo make install" to install Xenomai libraries and tools, gcc reports an error posted below:
--------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c: In function ‘iniparser_load’:
/home/rany/build_rtos/xenomai/src/xenomai-3.1/lib/boilerplate/iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict]   616 |             sprintf(tmp, "%s:%s", section, key);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-------------------------------------------------------------------
Shall I ignore it?

Quoted 6 lines

-------------------------------------------------------------------
Some info lost in last mail:
gcc 10.2.1
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux Xenomai 3.1
-------------------------------------------------------------------

I have the same setup here, and there is no such warning. There is no sprintf in iniparser.c:616. Are you sure it's Xenomai 3.1 you're looking at?

Quoted 6 lines
Quoted 3 lines

Some time ago I had to update the iniparser (from its upstream source) to get rid of such compiler warnings.

That fix was merged into master and stable/v3.1.x long ago. You just need to use the latest stable release.

Just noticed that the stable/3.0 branch still has this issue. So maybe it was about 3.0 and not 3.1?

Quoted 7 lines

@Jan
I noticed that 3.0 is broken when trying to update xenomai images to Debian 11. IOW: 3.0 is not buildable with Debian 11. Should we apply

8acdbd718b78 ("lib/boilerplate/iniparser: Allow building with GCC 10.2 2020101")

to stable/3.0 as well? It applies cleanly.

Done, thanks.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 18 lines · On 10.09.21 03:08, rany97 wrote:

Sorry for not replying properly.
I got Xenomai
from https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2.
<https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2>
The problem have been solved by using xenomai-stable-3.1.x got
from https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x
<https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x><https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x>
But new errors happened, they seems similar:
-------------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:
In function ‘heapobj_pkg_init_shared’:
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:859:11:
error: ‘%s’ directive output may be truncated writing up to 287 bytes
into a region of size 250 [-Werror=format-truncation=]
  859 |    "/xeno:%s", hobj->name);
      |           ^~
......
......

Quoted 9 lines

/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:
In function ‘heapobj_bind_session’:
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:987:11:
error: ‘%s’ directive output may be truncated writing up to 287 bytes
into a region of size 250 [-Werror=format-truncation=]
  987 |    "/xeno:%s", hobj->name);
      |           ^~
------------------------------------------------------------------------

Good point , Florian should have seen that as well already:
We need to merge
https://source.denx.de/Xenomai/xenomai/-/commit/6fff5236239a752ea0328e6bfee1b
into stable 3.1 as well. Will do,

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#7 lore raw
Quoted 29 lines · Jan Kiszka
Quoted 18 lines · On 10.09.21 03:08, rany97 wrote:

Sorry for not replying properly.
I got Xenomai
from https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2.
<https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2>
The problem have been solved by using xenomai-stable-3.1.x got
from https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x
<https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x><https://source.denx.de/Xenomai/xenomai/-/tree/stable/v3.1.x>
But new errors happened, they seems similar:
-------------------------------------------------------------------------
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:
In function ‘heapobj_pkg_init_shared’:
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:859:11:
error: ‘%s’ directive output may be truncated writing up to 287 bytes
into a region of size 250 [-Werror=format-truncation=]
  859 |    "/xeno:%s", hobj->name);
      |           ^~
......
......

Quoted 9 lines

/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:
In function ‘heapobj_bind_session’:
/home/rany/build_rtos/xenomai/src/xenomai-stable-v3.1.x/lib/copperplate/heapobj-pshared.c:987:11:
error: ‘%s’ directive output may be truncated writing up to 287 bytes
into a region of size 250 [-Werror=format-truncation=]
  987 |    "/xeno:%s", hobj->name);
      |           ^~
------------------------------------------------------------------------

Quoted 4 lines

Good point , Florian should have seen that as well already:
We need to merge
https://source.denx.de/Xenomai/xenomai/-/commit/6fff5236239a752ea0328e6bfee1b
into stable 3.1 as well. Will do,

I'm currently facing some test failures (likely switchtest) with the new compiler, but no build failure so far...

Quoted 3 lines

Jan