C++ compilation error because of uninitialized const member

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

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
embedded-iot

Research direction

Start in xdppsu.h around line 140 and inspect the XVidC_VideoTimingMode definition and its use in XDpPsu_MainStreamAttributes. Reproduce C++ instantiation of XDpPsu, then verify that the header no longer produces the reported deleted-constructor and uninitialized-const-member errors.

Written by the indexing model from the issue text.

Description

Instantiating XDpPsu from xdppsu.h in a C++ project results in the following errors:

use of deleted function 'XDpPsu::XDpPsu()'
use of deleted function 'XDpPsu_MainStreamAttributes::XDpPsu_MainStreamAttributes()'
use of deleted function 'XVidC_VideoTimingMode::XVidC_VideoTimingMode()'
uninitialized const member in 'struct XVidC_VideoTimingMode'
'const char XVidC_VideoTimingMode::Name [21]' should be initialized

The issue is that XDpPsu_MainStreamAttributes struct includes XVidC_VideoTimingMode struct as a member variable by value, whereas XVidC_VideoTimingMode is meant to be used as a pointer to a constant element in a timing array. XVidC_VideoTimingMode cannot be default-constructed because its const char Name[21] is not initialized.

https://github.com/Xilinx/embeddedsw/blob/338150ab3628a1ea6b06e964b16e712b131882dd/XilinxProcessorIPLib/drivers/dppsu/src/xdppsu.h#L140

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

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.

More from Xilinx/embeddedsw

All issues in Xilinx/embeddedsw

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.