Skip to content

Conversation

@gschorcht
Copy link
Contributor

Contribution description

The compilation of tests/log_color fails with GCC version in the new toolchain for ESP8266 in PR https://github.com/RIOT-OS/riotdocker with:

tests/log_color/main.c:27:5: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
     LOG_ERROR(format, value, string);
     ^
...

The reason is that this GCC version does not accept a character pointer as sting literal for the format argument in printf. The GCC version is 5.2.0.

This PR defines the format as string constant to fix the problem. It works for all other GCC version and platforms.

The problem occurred while testing PR #11108.

Testing procedure

The compilation for all platforms has to succeed.

Issues/PRs references

Required by PR #11108.

printf function requires a string literal as the format argument. Using a character pointer is not accepted as string literal by some compilers.
@gschorcht gschorcht requested a review from aabadie October 19, 2019 15:12
@gschorcht gschorcht added Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Oct 19, 2019
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Changes are good and required for ESP8266. Let's merge this.

ACK

@aabadie aabadie merged commit 798d317 into RIOT-OS:master Oct 19, 2019
@gschorcht
Copy link
Contributor Author

@aabadie Thanks 😄

@gschorcht gschorcht deleted the tests/log_color branch October 20, 2019 10:54
@fjmolinas fjmolinas added this to the Release 2020.01 milestone Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants