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
Inhibit GCC warning -Wmaybe-uninitialized in DMD_OBJS #3543
Inhibit GCC warning -Wmaybe-uninitialized in DMD_OBJS #3543
Conversation
Are any of these not false positives? I'd rather just leave this as-is as they'll automatically be initialized when we switch the frontend to D. If you've found actual bugs that's a different story. |
The main reason for removing warnings issued by a specific warning flag is not to find current bugs, but to prevent users from accidentally adding new ones without them knowing about it. If the output is littered with warnings the user wont read the new ones he causes. |
@@ -3984,6 +3984,8 @@ Expression *Parser::parseDefaultInitExp() | |||
e = new FuncInitExp(token.loc); | |||
else if (token.value == TOKprettyfunc) | |||
e = new PrettyFuncInitExp(token.loc); | |||
else | |||
e = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace e = NULL;
with assert(0);
I don't really know what to do about the flags that are not common to gcc and clang - I suggest leave them there, but comment them out with an explanation. |
Yup, exactly right. |
Switching to D gets rid of all these warnings. |
I've fixed your comments. Floats are set to 0.0 instead of nan. I also added a dependency to posix.mak itself for each object built so code is rebuilt whenever I change the warnings. I hope that's ok. |
Auto-merge toggled on |
Inhibit GCC warning -Wmaybe-uninitialized in DMD_OBJS
Should I continue fixing GLUE, BACK and ROOT or focus on remaining warnings in DMD? |
Fix Issue 22218 - Dynamic casts across binary boundaries can easily fail
First of a bunch starting with possible Heisenbugs.
Should I fix GLUE, BACK and ROOT aswell in this commit?
Floating points are nan-initialized when needed. I'm however unsure about the string arguments to
nan
,nanl
,nanf
so I've set them to?
for now.I've further explicitly added
-Wno...
to all issued by-Wall
and-Wextra
both a common set and those specific to either GCC or Clang. Each one can then be removed fromWARNINGS
and instead put into(DMD|GLUE|BACK|ROOT)_FLAGS
instead.This may require some logic as some of these flags are not compatible with both GCC and Clang. For now this -Wmaybe-uninitialized issue warnings when dmd is compiled using Clang. This logic needs to be fixed somehow. Tell me how you want this and I'll fix it :)
Update: I see now that the failure on test compile hosts with older GCC requires casing on compiler version instead if we want to use newer warnings such as
-Wmaybe-uninitialized
. Should we implement this casing or start inhibiting other warnings from -Wall and -Wextra that are compatible with previous GCC versions and then finally activate-Wextra
?