-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Should build with -Wunused and -pedantic #1158
Comments
assigned to @asl |
We should supply -Wno-long-long in this case. Or do something with "long long". |
Is long long a problem? If so, I'd suggest making it a separate bug, because fixing it would be -Chris |
According to http://gcc.gnu.org/onlinedocs/gcc/Long-Long.html#Long%20Long |
Ooooh, I was confused, sorry! Right, using "-pedantic -Wno-long-long" would be a great first step. As a I'm sorry, for some reason I thought -Wno-long-long would make gcc warn about long long. :) -Chris |
I recompiled again with -Wno-long-long and the only warning was in In function The function is safely wrapped in HAVE_PRINTF_A and looks like: static bool isFPCSafeToPrint(const ConstantFP *CFP) { if (!strncmp(Buffer, "0x", 2) || I'm not sure what to do about this one. All the others are long long related. |
Thanks Reid! I think GCC has an extension token, maybe it can be used here? I'm not in favor of turning of turning on the option until the code is completely cleaned up. I will see if I -Chris |
Just a note to indicate that -Wno-long-long is useful in conjunction with sprintf(Buffer, "0x%llx", static_cast(uint64_t(ll))); With -pedantic we get an error (don't support long long) and a warning (don't |
As of this date, -pedantic and -Wno-long-long are turned on by default. The lib/System/rtld.c |
These need to be addressed: /proj/llvm/build/../llvm/lib/Target/CBackend/Writer.cpp: In function |
Another hard error: This only happens on the persephone nightly tester (Mac OS/X). This has been temporarily disabled until we can get a configure test going to |
Reid, don't we compile with -pedantic now? If so, should we split this into two bugs (one for -pedantic -Chris |
Chris, Currently both -pedantic and -Wno-unused are turned on by default (in I don't think there's much point in create a bug for each option. We are not Reid. |
Ok, sounds good, makes sense. I forgot that some dirs disabled the warning. BTW, we want -Wunused, Thanks, -Chris |
The -pedantic option is done. Its turned off where it needs to be. We currently compile with -Wno-unused. Changing it to -Wunused leads to hundreds |
Well, ok. Will try to fight with -Wunused this weekend. |
It seems, we should really use -Wno-unused-parameter. |
I think the combination of -Wunused and then -Wno-unused-parameter would be |
I just tried it. That seems like a good combination. Its only picking up unused |
Output from compiler |
Thanks Anton! It would be great to be -Wunused clean for the release! -Chris |
The -Wunused and -Wno-unused-parameter flags are now turned on by default. Most
Developers and maintainers should strive to clean up the remaining few warnings This bug is done. |
These are the ones that remain: include/llvm/Analysis/DataStructure/DSGraphTraits.h:113: utils/PerfectShuffle/PerfectShuffle.cpp:64: utils/TableGen/Lexer.cpp:886: lib/Transforms/Scalar/CorrelatedExprs.cpp:1152: lib/AsmParser/Lexer.cpp:1222: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:161: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:183: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:44: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:260: lib/Target/X86/X86ISelDAGToDAG.cpp:934: lib/Target/X86/X86RegisterInfo.cpp:1068: lib/Target/Sparc/Sparc.h:82: lib/Target/PowerPC/PPCGenSubtarget.inc:468: lib/Target/Alpha/AlphaGenDAGISel.inc:290: lib/Target/Alpha/AlphaRegisterInfo.cpp:55: lib/Target/Alpha/AlphaGenSubtarget.inc:118: lib/Target/IA64/IA64ISelLowering.cpp:134: |
One more thing, we still have -pedantic turned off in: lib/AsmParser/Makefile These should eventually be cleaned up too. |
mentioned in issue llvm/llvm-bugzilla-archive#981 |
Extended Description
This isn't really a makefile bug, but there is no better place to put it.
We should stop passing -Wno-unused to the LLVM build, and we should start passing -pedantic to the
LLVM build.
Making the change is easy, the "hard" part is trying it out any fixing any of the minor issues that pop up.
-Chris
The text was updated successfully, but these errors were encountered: