Xilinx / Xilinx/embeddedsw

Standalone bsp os fails to build under mb-g++

Open
#334 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

When the os compiler option is set to "mb-g++", Standalone OS will fail to build with following errors:

xil_mem.c: In function 'void Xil_MemCpy(void*, const void*, u32)':
xil_mem.c:50:25: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
50 | const char s = src;
| ^~~
| |
| const void

xil_sutil.c:880:24: error: invalid conversion from 'void*' to 'u8*' {aka 'unsigned char*'} [-fpermissive]
880 | u8 DestTemp = Dest;
| ^~~~
| |
| void

xil_sutil.c:881:29: error: invalid conversion from 'const void*' to 'const u8*' {aka 'const unsigned char*'} [-fpermissive]
881 | const u8 SrcTemp = Src;
| ^~~
| |
| const void

xil_util.c:554:26: error: invalid conversion from 'const void*' to 'const u8*' {aka 'const unsigned char*'} [-fpermissive]
554 | const u8 Buf1 = Buf1Ptr;
| ^~~~~~~
| |
| const void

xil_util.c:555:26: error: invalid conversion from 'const void*' to 'const u8*' {aka 'const unsigned char*'} [-fpermissive]
555 | const u8 Buf2 = Buf2Ptr;
| ^~~~~~~
| |
| const void

This was tested with v9.2 of the Standalone OS. It is highly expected that older versions are also affected by this.

All the flagged bugs above require explicit casting from void* to target type.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with xil_mem.c:50, xil_sutil.c:880-881, and xil_util.c:554-555, then reproduce the Standalone OS build with the os compiler option set to mb-g++. Check that the affected pointer assignments are accepted under this compiler and that the build completes without the reported conversion errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
build-system, embedded-iot, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.