-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix gcc warnings in core_http_client.c. Update ci.yml. #101
base: main
Are you sure you want to change the base?
Fix gcc warnings in core_http_client.c. Update ci.yml. #101
Conversation
e7a0c2f
to
6dc1426
Compare
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.
Unless there is absolute necessity, HTTP parser should not be updated. It should be also tested before updating.
The change itself is very minimal and is just to quiet a gcc warning. It is absolutely necessary to do so or we can't enable -Werror and will continue to miss compiler warnings. Here's one of the warnings generated by the library:
|
f966279
to
a342513
Compare
run: | | ||
cd build/ | ||
cd build | ||
make coverage |
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.
(Minor) What's the purpose of building coverage
target instead of just the unit test binaries with the all
target when the next step in this job runs test for coverage?
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.
The all
target does not run the unit tests, only the coverage target does.
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.
You don't need the coverage
target to build and run the unit tests necessarily. The ctest
command takes care of running the unit tests
sudo apt-get install -y cmake lcov | ||
CFLAGS=" --coverage -O0 -Wall -Wextra" | ||
CFLAGS+=" -Werror -Wno-error=pedantic" | ||
CFLAGS+=" -D_FORTIFY_SOURCE=2" |
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.
Can you add a comment about what this configuration and its value does?
@@ -1340,9 +1340,9 @@ static HTTPStatus_t addHeader( HTTPRequestHeaders_t * pRequestHeaders, | |||
pBufferCur += fieldLen; | |||
|
|||
/* Copy the field separator, ": ", into the buffer. */ | |||
( void ) strncpy( pBufferCur, |
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.
Just leaving this here: This was the commit where we changed memcpy to strncpy to satisfy Coverity :
e0ebc00
8fb5bac
to
166cbe0
Compare
Also enables -Werror and -Wno-error=pedantic so that new warnings cause a failed CI build. This includes FORTIFY_SOURCE warnings.
32b5837
to
4b1ff21
Compare
Fix gcc warnings in http_parser and core_http_client.c.
Update ci.yml to use the latest ubuntu image and -Werror and -fsanitize.