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

Warnings on build #18

Closed
shane-ns1 opened this issue Oct 25, 2023 · 0 comments · Fixed by #19
Closed

Warnings on build #18

shane-ns1 opened this issue Oct 25, 2023 · 0 comments · Fixed by #19
Milestone

Comments

@shane-ns1
Copy link

We're seeing warnings on the build:

mdb.c: In function 'mdb_env_cwalk':
mdb.c:9273:7: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
 9273 |       memcpy(NODEDATA(ni), &my->mc_next_pgno, sizeof(pgno_t));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mdb.c:941:8: note: at offset 0 to object 'mn_data' with size 1 declared here
  941 |  char  mn_data[1];   /**< key and data are appended here */
      |        ^~~~~~~
mdb.c: In function 'mdb_node_add':
mdb.c:7412:4: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
 7412 |    memcpy(ndata, &ofp->mp_pgno, sizeof(pgno_t));
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mdb.c:7406:5: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
 7406 |     memcpy(ndata, data->mv_data, sizeof(pgno_t));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Since our Go version trusts our C coders to have figured out stuff like this, we can just ignore these (a quick inspection reveals that they are almost certainly false positives). PR incoming.

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 a pull request may close this issue.

2 participants