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

1.4.2: compile time warnings #708

Closed
kloczek opened this issue Sep 13, 2022 · 1 comment
Closed

1.4.2: compile time warnings #708

kloczek opened this issue Sep 13, 2022 · 1 comment

Comments

@kloczek
Copy link

kloczek commented Sep 13, 2022

First just summary stats:

[tkloczko@pers-jacek SPECS]$ rpmbuild -ba --quiet 2>&1 | grep -- \\[-W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr
   1012 -Wsign-compare
     70 -Wclass-memaccess
     18 -Wunused-variable
      6 -Wunused-but-set-variable
      6 -Walloc-size-larger-than=

In attachment are extracted all warnings mold_warnings.txt

rui314 added a commit that referenced this issue Sep 14, 2022
GCC prints out bunch of the following warnings when compiling mold.

```
macho/input-files.cc:717:11: warning: 'void* memset(void*, int, size_t)'
  clearing an object of non-trivial type 'struct mold::macho::MachSection';
  use assignment or value-initialization instead [-Wclass-memaccess]

  717 |     memset(hdr, 0, sizeof(*hdr));
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
```

This commit suppresses it by making our classes trivial.

#708
rui314 added a commit that referenced this issue Sep 14, 2022
@rui314
Copy link
Owner

rui314 commented Sep 14, 2022

All warnings should be fixed by now.

@rui314 rui314 closed this as completed Sep 14, 2022
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

No branches or pull requests

2 participants