Bug 1250768 - warning: 'sizeof' on array function parameter 'tx_stream_indices' will return size of 'const uint32_t* {aka const unsigned int*}' [-Wsizeof-array-argument]
warning: 'sizeof' on array function parameter 'tx_stream_indices' will return...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: uhd (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-05 21:07 EDT by Jonathan Wakely
Modified: 2016-12-06 05:25 EST (History)
1 user (show)

See Also:
Fixed In Version: uhd-3.10.1.0-1.fc25 uhd-3.10.1.0-1.fc24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-05 16:41:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Untested patch to deduce the array length. (702 bytes, patch)
2015-08-05 21:08 EDT, Jonathan Wakely
no flags Details | Diff

  None (edit)
Description Jonathan Wakely 2015-08-05 21:07:32 EDT
In file included from /builddir/build/BUILD/uhd-release_003_008_002/host/include/uhd/transport/nirio/niriok_proxy.h:27:0,
                 from /builddir/build/BUILD/uhd-release_003_008_002/host/include/uhd/transport/nirio/niusrprio_session.h:24,
                 from /builddir/build/BUILD/uhd-release_003_008_002/host/utils/usrp_x3xx_fpga_burner.cpp:43:
/builddir/build/BUILD/uhd-release_003_008_002/host/include/uhd/transport/nirio/nirio_quirks.h: In member function 'void uhd::niusrprio::nirio_quirks::register_tx_streams(const uint32_t*)':
/builddir/build/BUILD/uhd-release_003_008_002/host/include/uhd/transport/nirio/nirio_quirks.h:39:56: warning: 'sizeof' on array function parameter 'tx_stream_indices' will return size of 'const uint32_t* {aka const unsigned int*}' [-Wsizeof-array-argument]
         for (size_t i = 0; i < sizeof(tx_stream_indices)/sizeof(*tx_stream_indices); i++) {
                                                        ^
/builddir/build/BUILD/uhd-release_003_008_002/host/include/uhd/transport/nirio/nirio_quirks.h:38:74: note: declared here
     UHD_INLINE void register_tx_streams(const uint32_t tx_stream_indices[]) {
                                                                          ^

This looks like a real bug.

sizeof(tx_stream_indices)/sizeof(*tx_stream_indices) cannot possibly do anything useful.

It will work by change on 64-bit targets because the only caller of that function (in host/lib/usrp/x300/x300_impl.cpp) passes an array of two elements, and sizeof(uint32_t*)/sizeof(uint32_t) == 2 for 64-bit targets, but for 32-bit targets == 1, so only the first stream will be registered.

Either the caller should pass in the array length or the function should be turned into a template so it can deduce the length.
Comment 1 Jonathan Wakely 2015-08-05 21:08:01 EDT
Created attachment 1059687 [details]
Untested patch to deduce the array length.
Comment 2 Jan Kurik 2016-02-24 08:34:51 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 3 Fedora Update System 2016-11-23 09:56:09 EST
gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc25 gnuradio-3.7.10.1-4.fc25 uhd-3.10.1.0-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-36549ad39b
Comment 4 Fedora Update System 2016-11-23 11:03:02 EST
gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc24 gnuradio-3.7.10.1-4.fc24 uhd-3.10.1.0-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a90a2cee2c
Comment 5 Fedora Update System 2016-11-25 04:39:16 EST
gnuradio-3.7.10.1-4.fc24, gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc24, uhd-3.10.1.0-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a90a2cee2c
Comment 6 Fedora Update System 2016-11-25 04:42:03 EST
gnuradio-3.7.10.1-4.fc25, gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc25, uhd-3.10.1.0-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-36549ad39b
Comment 7 Fedora Update System 2016-12-05 16:41:21 EST
gnuradio-3.7.10.1-4.fc25, gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc25, uhd-3.10.1.0-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2016-12-06 05:25:21 EST
gnuradio-3.7.10.1-4.fc24, gr-osmosdr-0.1.3-23.20141023git42c66fdd.fc24, uhd-3.10.1.0-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.