Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PGPRO-5646: remove compiler warning (gcc 11.2.0)#11

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ziva777 merged 1 commit intomasterfromPGPRO-5646
Oct 22, 2021

Conversation

MarinaPolyakova
Copy link
Contributor

In function ‘ptrack_write_chunk’,
inlined from ‘ptrackCheckpoint’ at engine.c:397:2:
engine.c:78:13: warning: ‘write’ reading 8 bytes from a region of size 4
[-Wstringop-overread]
78 | if (write(fd, chunk, size) != size)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from engine.c:47:
engine.c: In function ‘ptrackCheckpoint’:
engine.h:55:25: note: source object ‘magic’ of size 4
55 | char magic[PTRACK_MAGIC_SIZE];
| ^~~~~
In file included from engine.c:22:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with
attribute ‘access (read_only, 2, 3)’
378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~

In C a pointer to the first field of a structure and a pointer to the structure
itself are always equal.

@codecov
Copy link

codecovbot commentedOct 8, 2021
edited
Loading

Codecov Report

Merging#11 (3dbc4fa) intomaster (3d6ccc6) willnot change coverage.
The diff coverage is100.00%.

Impacted file tree graph

@@           Coverage Diff           @@##           master      #11   +/-   ##=======================================  Coverage   87.40%   87.40%           =======================================  Files           2        2             Lines         381      381           =======================================  Hits          333      333             Misses         48       48
Impacted FilesCoverage Δ
engine.c84.64% <100.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update3d6ccc6...3dbc4fa. Read thecomment docs.

In function ‘ptrack_write_chunk’,    inlined from ‘ptrackCheckpoint’ at engine.c:397:2:engine.c:78:13: warning: ‘write’ reading 8 bytes from a region of size 4[-Wstringop-overread]   78 |         if (write(fd, chunk, size) != size)      |             ^~~~~~~~~~~~~~~~~~~~~~In file included from engine.c:47:engine.c: In function ‘ptrackCheckpoint’:engine.h:55:25: note: source object ‘magic’ of size 4   55 |         char            magic[PTRACK_MAGIC_SIZE];      |                         ^~~~~In file included from engine.c:22:/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared withattribute ‘access (read_only, 2, 3)’  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur      |                ^~~~~In C a pointer to the first field of a structure and a pointer to the structureitself are always equal. Add a compile-time assertion check in case the fieldmagic is not the first field in the structure PtrackMapHdr in the future.Thanks to Maksim Orlov for the review.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ziva777ziva777Awaiting requested review from ziva777

Assignees

@ziva777ziva777

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@MarinaPolyakova@ziva777

[8]ページ先頭

©2009-2025 Movatter.jp