Skip to content

fix: silence some compiler warnings - #7318

Merged
pajlada merged 2 commits into
Chatterino:masterfrom
netfab:fix_compiler_warnings
Sep 27, 2026
Merged

pajlada merged 2 commits into
Chatterino:masterfrom
netfab:fix_compiler_warnings

Conversation

@netfab

@netfab netfab commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

This silence two compiler warnings (described in commit message).

@Nerixyz

Nerixyz commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

(described in commit message)

We use squash merges and usually take the description from the pull request, not the individual commit(s).

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for your contribution.

I'd prefer if this uses std::ignore. If there's a reason we should use [[maybe_unused]] instead, please enlighten me 🙏

@netfab

netfab commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

I'd prefer if this uses std::ignore. If there's a reason we should use [[maybe_unused]] instead, please enlighten me 🙏

There's no particular reason, I've used it often lately, that's why I used it here.
In this context, the only difference I see is that using [[maybe_unused]] avoids to include an additional header.
Do you want me to make the change ?

@pajlada

pajlada commented Sep 26, 2026

Copy link
Copy Markdown
Member

I'd prefer if this uses std::ignore. If there's a reason we should use [[maybe_unused]] instead, please enlighten me 🙏

There's no particular reason, I've used it often lately, that's why I used it here. In this context, the only difference I see is that using [[maybe_unused]] avoids to include an additional header. Do you want me to make the change ?

Yes please - thank you!

> [...]/chatterino-9999/src/util/UnixSignalHandler.cpp:
> 	In static member function ‘static void
>          chatterino::UnixSignalHandler::fired(int)’:
> [...]/chatterino-9999/src/util/UnixSignalHandler.cpp:71:12:
>       warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’
>          declared with attribute ‘warn_unused_result’ [-Wunused-result]
>    71 |     ::write(cls->fd[0], &a, sizeof(a));
>       |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> [...]/chatterino-9999/src/util/UnixSignalHandler.cpp:
>       In member function ‘void
>          chatterino::UnixSignalHandler::handleSignal()’:
> [...]/chatterino-9999/src/util/UnixSignalHandler.cpp:79:11:
>       warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’
>          declared with attribute ‘warn_unused_result’ [-Wunused-result]
>    79 |     ::read(this->fd[1], &tmp, sizeof(tmp));
>       |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Fabrice Delliaux <netbox253@gmail.com>
@netfab
netfab force-pushed the fix_compiler_warnings branch from 000a728 to 4b59337 Compare September 26, 2026 22:26
@pajlada
pajlada enabled auto-merge (squash) September 27, 2026 09:16
@pajlada
pajlada merged commit ae9744f into Chatterino:master Sep 27, 2026
18 checks passed
@pajlada

pajlada commented Sep 27, 2026

Copy link
Copy Markdown
Member

Thank you! As a first-time contributor, you are now eligible to be listed in the About page in Chatterino.

If you want this, you can open a new PR where you modify the resources/contributors.txt file and add yourself to the list. Read the comments at the top for instructions.

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.

3 participants