Skip to content

shell/sc_can: fix uninitialized warning [backport 2018.07]#9644

Merged
miri64 merged 1 commit intoRIOT-OS:2018.07-branchfrom
cladmi:2018.07/pr/sc_can/uninitialized
Jul 31, 2018
Merged

shell/sc_can: fix uninitialized warning [backport 2018.07]#9644
miri64 merged 1 commit intoRIOT-OS:2018.07-branchfrom
cladmi:2018.07/pr/sc_can/uninitialized

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Jul 27, 2018

Backport of #9627

Contribution description

When compiled for hifive1 board with gcc-7.2.0 this warning was raised:

'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This was first mentioned in RIOT-OS/riotdocker#42 (comment)

Testing

The board does not have enough memory but the error is triggered when compiling with a gcc version 7.2.0:

make -C tests/conn_can/ BOARD=hifive1 RIOT_CI_BUILD=1

Warning is dismissed, it was just a testing procedure error.

Warning

Currently when compiling with riscv-none-embed-gcc (GNU MCU Eclipse RISC-V Embedded GCC, 64-bits) 7.2.0 a linker error is raised

make -C tests/conn_can/ BOARD=hifive1
...
/opt/gnu-mcu-eclipse/riscv-none-gcc/7.2.0-2-20180111-2230/bin/../lib/gcc/riscv-none-embed/7.2.0/../../../../riscv-none-embed/bin/ld: section .stack VMA [0000000080003c00,0000000080003fff] overlaps section .bss VMA [00000000800001f8,0000000080003eaf]
collect2: error: ld returned 1 exit status
/data/riotbuild/riotbase/Makefile.include:356: recipe for target '/data/riotbuild/riotproject/tests/conn_can/bin/hifive1/tests_conn_can.elf' failed
make: *** [/data/riotbuild/riotproject/tests/conn_can/bin/hifive1/tests_conn_can.elf] Error 1
/home/user/Desktop/RIOT_master_old/makefiles/docker.inc.mk:90: recipe for target '..in-docker-container' failed
make: *** [..in-docker-container] Error 2

The goal of this PR is to resolve the linking bug and merge this.

Issues/PRs references

#9405
RIOT-OS/riotdocker#42
Found it during release testing

@cladmi cladmi added Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … labels Jul 27, 2018
@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 28, 2018
@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 30, 2018
When compiled for `hifive1` board with `gcc-7.2.0` this warning was raised:

'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

(cherry picked from commit eec88e3)
@cladmi cladmi force-pushed the 2018.07/pr/sc_can/uninitialized branch from 1c7c20d to 8462cfe Compare July 31, 2018 15:51
@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 31, 2018
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, change looks simple and I confirmed, that in the current release branch this issue exist and it is indeed fixed by this PR.

@miri64 miri64 merged commit 50b7732 into RIOT-OS:2018.07-branch Jul 31, 2018
@cladmi cladmi deleted the 2018.07/pr/sc_can/uninitialized branch July 31, 2018 18:21
@cladmi cladmi added this to the Release 2018.07 milestone Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants