-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplereader: Fix compilation #222
Open
olheureu
wants to merge
1
commit into
intel:main
Choose a base branch
from
olheureu:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
simplereader: Fix compilation
Compilation of "simplereader.c" failed with an error message, on ARM7 embedded linux and GCC 9.3.0: arm-ngrave-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=[...] -c -pipe -O2 -pipe -g -feliminate-unused-debug-types -ffunction-sections -fdata-sections -Wall -Wextra -fPIC -DNDEBUG -I. -I../src -I/[...]/mkspecs/linux-oe-g++ -o simplereader.o simplereader.c simplereader.c: In function 'main': simplereader.c:181:19: error: 'CborValue' {aka 'struct CborValue'} has no member named 'ptr' 181 | it.ptr - buf, cbor_error_string(err)); | ^ Makefile:653: recipe for target 'simplereader.o' failed make: *** [simplereader.o] Error 1 Fixing the error is pretty simple, because the "struct CborValue" is defined in "src/cbor.h" as: struct CborValue { const CborParser *parser; union { const uint8_t *ptr; void *token; } source; [...] }; So we need to specify the "source" member of the "struct CborValue", between "it" and "ptr": "it.ptr" -> "it.source.ptr" This fixes the compilation error. Signed-off-by: Olivier L'Heureux <olivier.lheureux@mind.be> Signed-off-by: Xavier Hendrickx <xavier.hendrickx@ngrave.io> Reviewed-by: Evgeny Beysembaev <evgeny.beysembaev@ngrave.io>
- Loading branch information
commit b39f5aa87310965c4121123f46952510939a399c
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct, but can you use
cbor_value_get_next_byte(&it)
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I will adapt this PR. I'll need a bit of time...