Skip to content
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 pedantic compiler warnings #161

Merged
merged 5 commits into from
Oct 19, 2020
Merged

Fix pedantic compiler warnings #161

merged 5 commits into from
Oct 19, 2020

Conversation

PJK
Copy link
Owner

@PJK PJK commented Oct 19, 2020

And improve overall macro and code hygiene

Fixes #160

@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #161 into master will increase coverage by 0.07%.
The diff coverage is 98.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #161      +/-   ##
==========================================
+ Coverage   92.64%   92.71%   +0.07%     
==========================================
  Files          52       52              
  Lines        3452     3458       +6     
  Branches      199      199              
==========================================
+ Hits         3198     3206       +8     
  Misses        198      198              
+ Partials       56       54       -2     
Impacted Files Coverage Δ
examples/create_items.c 0.00% <0.00%> (ø)
examples/hello.c 0.00% <0.00%> (ø)
examples/sort.c 0.00% <0.00%> (ø)
examples/streaming_parser.c 0.00% <0.00%> (ø)
src/cbor/callbacks.c 100.00% <100.00%> (ø)
src/cbor/internal/builder_callbacks.c 90.08% <100.00%> (ø)
test/bad_inputs_test.c 100.00% <100.00%> (ø)
test/callbacks_test.c 100.00% <100.00%> (ø)
test/cbor_serialize_test.c 100.00% <100.00%> (ø)
test/cbor_stream_decode_test.c 100.00% <100.00%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06e6221...d644118. Read the comment docs.

@PJK PJK merged commit 6361ad5 into master Oct 19, 2020
@mu578
Copy link

mu578 commented Oct 21, 2020

hello thank you,

however, I'd go by:

#	if defined(__GNUC__)
#		define _CBOR_UNUSED_ATTR(x) __attribute__((__unused__)) x
#		define _CBOR_UNUSED         _CBOR_UNUSED_ATTR
#	elif defined(_MSC_VER)
#		define _CBOR_UNUSED_ATTR(x) __pragma(warning(suppress: 4100 4101)) x
#		define _CBOR_UNUSED         _CBOR_UNUSED_ATTR
#	else
#		define _CBOR_UNUSED_ATTR(x) x
#		define _CBOR_UNUSED(x)      (void)x
#	endif

BTW, did you start looking at date/times TAG introduction? as per draft https://tools.ietf.org/html/draft-ietf-cbor-date-tag-04

@PJK
Copy link
Owner Author

PJK commented Oct 25, 2020

Sent #165 to address MSVC. The last fallback will not work when applied to parameters.

BTW, did you start looking at date/times TAG introduction? as per draft https://tools.ietf.org/html/draft-ietf-cbor-date-tag-04

No, the tag registry hasn't been addressed at all. Filed #166, feel free to propose something.

@mu578
Copy link

mu578 commented Oct 26, 2020

Hello, that's the reason I'd differentiate attribute vs scope tagging using two macros; in general, body/scope tagging is preferable to function arguments tagging for the sake of portability and readability. #165

For cbor datetime TAG proposal looks like to be a "root one" not a sub-control value as per draft, split in two kinds; (I might be wrong); so could draft-code the logic using an arbitrary unused TAG value. although, RFC3339 parser/check routine needed. #166

@mu578
Copy link

mu578 commented Nov 4, 2020

file.diff.txt

forgot one initializer ; not in file diff

struct _cbor_string_metadata {
  size_t length;
  size_t codepoint_count; /* Sum of chunks' codepoint_counts for indefinite
                             strings */
  _cbor_dst_metadata type;
};

.metadata = {.string_metadata = {0, 0, _CBOR_METADATA_DEFINITE}}};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pedantic build failing 0.8.0
3 participants