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

Docs: add an entry about compiler warnings#8492

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
mcspr merged 3 commits intoesp8266:masterfrommcspr:warnings-inhibitor
Feb 22, 2022

Conversation

@mcspr
Copy link
Collaborator

per#8421 and#8475
after checking HW, suggest to check SW as well at least by enabling compiler warnings
(and also note of the IDE weirdest defaults causing issues we expected to stay solved)

Copy link
Collaborator

@d-a-vd-a-v left a comment

Choose a reason for hiding this comment

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

This was missing.

@earlephilhower
Copy link
Collaborator

earlephilhower commentedFeb 20, 2022
edited
Loading

Don't wealways generate a warning/error on this case, even withNone? If not, I think we can fix it instead of documenting it, by changing theplatform.txt options...

compiler.warning_flags.none=-w -Werror=return-type

d-a-v reacted with thumbs up emoji

@mcspr
Copy link
CollaboratorAuthor

only 3 out of 4 options produce error:

Arduino/platform.txt

Lines 24 to 28 in15e7d35

compiler.warning_flags=-w -Werror=return-type
compiler.warning_flags.none=-w -Werror=return-type
compiler.warning_flags.default=-Werror=return-type
compiler.warning_flags.more=-Wall -Werror=return-type
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type

'None' never does,-w overrides any-W flags since they apply all at once and not like 'disable all warningsbut still enable this one', order does not matter. Removing-w from 'None' kind of defeats the purpose of the option, and there is 'Default' for that.

We do still need to mention the warnings, which even in 'Default' will give some useful advice. Specifically with C++, shouldn't we mention that it is undefined behaviour when trying to code like that?

btw low-level routines that really do not return may still be coded like this

intfunc() {__builtin_unreachable();}

@earlephilhower
Copy link
Collaborator

Argh, you are correct. Even trying to explicitly enable a warning like-w -Wreturn-type -Werror=return-type doesn't work.

It seems the only way to make this automatically catch is to not use-w and specifically list all ~100-Wno-XXX in an@option file. While doable, that's more involved than I have time for this AM...

@mcsprmcspr merged commitfd53a08 intoesp8266:masterFeb 22, 2022
@mcsprmcspr deleted the warnings-inhibitor branchFebruary 22, 2022 10:42
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull requestNov 18, 2024
peresp8266#8421 andesp8266#8475after checking HW, suggest to check SW as well by at least by enabling some or all compiler warnings(and also note of the IDE weirdest defaults causing issues we expected to stay solved)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@earlephilhowerearlephilhowerearlephilhower approved these changes

@d-a-vd-a-vd-a-v approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@mcspr@earlephilhower@d-a-v

[8]ページ先頭

©2009-2025 Movatter.jp