summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/warning-flags.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Integers which are too large should be an error.Eli Friedman2013-07-231-5/+1
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Delete dead code.Eli Friedman2013-06-211-2/+1
| | | | llvm-svn: 184517
* Warn on va_start() when called with a reference parameter.Nico Weber2013-05-241-3/+1
| | | | | | | | | http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf 18.7p3 explicitly calls this (and some other things) out as undefined. Also move 2 other existing warnings behind the new -Wvarargs flag. llvm-svn: 182694
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-2/+1
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* After issuing a diagnostic for undefining or redefining a builtin macro,Richard Smith2013-03-061-2/+1
| | | | | | | | | continue parsing the directive rather than silently discarding it. Allowing undef or redef of __TIME__ and __DATE__ is important to folks who want stable, reproducible builds. llvm-svn: 176540
* Add missing InGroup for this warning.Nick Lewycky2013-01-251-2/+1
| | | | llvm-svn: 173429
* Give warn_redecl_library_builtin a flag name: ↵Nick Lewycky2013-01-241-2/+1
| | | | | | -Wincompatible-library-redeclaration. llvm-svn: 173319
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-201-2/+1
| | | | | | | | produce a note for that diagnostic either with a different DiagnosticEngine or after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the wrong thing if the original diagnostic was suppressed. llvm-svn: 170636
* Add -Wmismatched-return-types flag for existing warning on conflicting ↵Ted Kremenek2012-11-071-2/+1
| | | | | | return types. llvm-svn: 167518
* Add -Wmismatched-parameter-types flag for existing warning on conflicting ↵Ted Kremenek2012-11-071-2/+1
| | | | | | parameter types. llvm-svn: 167515
* Add missing diagnostic group to format string warning.Eli Friedman2012-11-021-2/+1
| | | | llvm-svn: 167279
* Tweak wording and add diagnostic groups to misc diagnostics.Eli Friedman2012-11-021-1/+1
| | | | llvm-svn: 167274
* Remove ccc-no-clang-cpp, which is also dead now.Rafael Espindola2012-10-301-2/+1
| | | | llvm-svn: 167062
* In the past "production" clang builds would not be used for c++, andRafael Espindola2012-10-301-2/+1
| | | | | | | | | we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them on or off for testing. Clang c++ support is now production quality and these options are dead. llvm-svn: 166986
* Update warning-flag testDouglas Gregor2012-10-251-2/+1
| | | | llvm-svn: 166656
* Revert r166647 to rethink the patch...Bill Wendling2012-10-251-2/+1
| | | | llvm-svn: 166655
* Add some support for diagnosing possibly mismatched constraint, type size andBill Wendling2012-10-251-1/+2
| | | | | | | modifiers. (From an idea by Eric...) <rdar://problem/12284092> llvm-svn: 166647
* Adds couple of missing warning flags so warnings can be turnedFariborz Jahanian2012-10-171-3/+1
| | | | | | off. // rdar://12501960 llvm-svn: 166150
* The clang driver has a fairly fancy support for executing gcc instead ofRafael Espindola2012-10-091-2/+1
| | | | | | | | | | | | | | clang itself. This dates back to clang's early days and while it looks like some of it is still used (for kext for example), other parts are probably dead. Remove the -ccc-clang-archs option and associated code. I don't think there is any remaining setup where clang doesn't support an architecture but it can expect an working gcc cross compiler to be available. A nice side effect is that tests no longer need to differentiate architectures that are included in production builds of clang and those that are not. llvm-svn: 165545
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-041-2/+1
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* PR13881: Add -Wzero-length-array for zero length array extension, and move ↵Richard Smith2012-09-201-1/+1
| | | | | | it into -Wgnu. llvm-svn: 164272
* Promote the warning about extra qualification on a declaration from aDouglas Gregor2012-09-131-2/+1
| | | | | | | | warning to an error. C++ bans it, and both GCC and EDG diagnose it as an error. Microsoft allows it, so we still warn in Microsoft mode. Fixes <rdar://problem/11135644>. llvm-svn: 163831
* Splitting the duplicated decl spec extension warning into two: one is an ↵Aaron Ballman2012-08-281-1/+1
| | | | | | ExtWarn and the other a vanilla warning. This addresses PR13705, where const char const * wouldn't warn unless -pedantic was specified under the right conditions. llvm-svn: 162793
* Fix horrible regression in control of warnings caused by introduction of ↵Ted Kremenek2012-08-101-2/+33
| | | | | | | | | | | | | | | -Wpedantic. While -Wpedantic was reasonable, -Wno-pedantic would turn off a bunch of warnings that are on by default. This counters the intention of this warning flag. To fix this, -Wpedantic now includes extentions that are not on by default. The remaining warnings will manifest anyway, and won't accidentally get turned off by -Wno-pedantic. Fixes <rdar://problem/12076105> llvm-svn: 161695
* PR13529: Don't crash if the driver sees an unused input file when running asRichard Smith2012-08-061-3/+1
| | | | | | | | | | 'clang-cpp'. For now, the test uses "REQUIRES: shell" to determine if the host system supports "ln -s", which it uses to create a 'clang-cpp' symlink. This is a bit hacky and should likely be directly supported by lit.cfg. llvm-svn: 161317
* Promote warn_unknown_analyzer_checker to an error. Addresses ↵Ted Kremenek2012-07-251-3/+3
| | | | | | <rdar://problem/10987863>. llvm-svn: 160706
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-231-4/+2
| | | | | | | | scope to -Wc++11-extensions. Move extra semicolon after member function definition diagnostic out of -pedantic, since C++ allows a single semicolon there. Keep it in -Wextra-semi, though, since it's still questionable. llvm-svn: 160618
* Move a bunch of the attribute warnings under the IgnoreAttributes group. ↵Tanya Lattner2012-07-131-29/+1
| | | | | | Cleaned up test case. llvm-svn: 160190
* TEMPORARY. I will fix this properly shortly.Tanya Lattner2012-07-091-1/+2
| | | | | | Silence buildbot so I can figure out the right flag to put this warning under. llvm-svn: 159967
* Enhance 'diagtool list-warnings' to report number of diagnostics covered ↵Ted Kremenek2012-07-071-0/+5
| | | | | | directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow. llvm-svn: 159893
* Re-apply r159875 with fixes.Ted Kremenek2012-07-071-72/+2
| | | | | | | - Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32 - Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic. llvm-svn: 159892
* Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement ↵NAKAMURA Takumi2012-07-071-2/+72
| | | | | | | | | | -Weverything." It broke several builds. I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test. > 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp llvm-svn: 159886
* Implement -Wpedantic and --no-pedantic to complement -Weverything.Ted Kremenek2012-07-061-72/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces some magic in tablegen to create a "Pedantic" diagnostic group which automagically includes all warnings that are extensions. This allows a user to suppress specific warnings traditionally under -pedantic used an ordinary warning flag. This also allows users to use #pragma to silence specific -pedantic warnings, or promote them to errors, within blocks of text (just like any other warning). -Wpedantic is NOT an alias for -pedantic. Instead, it provides another way to (a) activate -pedantic warnings and (b) disable them. Where they differ is that -pedantic changes the behavior of the preprocessor slightly, whereas -Wpedantic does not (it just turns on the warnings). The magic in the tablegen diagnostic emitter has to do with computing the minimal set of diagnostic groups and diagnostics that should go into -Wpedantic, as those diagnostics that already members of groups that themselves are (transitively) members of -Wpedantic do not need to be included in the Pedantic group directly. I went back and forth on whether or not to magically generate this group, and the invariant was that we always wanted extension warnings to be included in -Wpedantic "some how", but the bookkeeping would be very onerous to manage by hand. -no-pedantic (and --no-pedantic) is included for completeness, and matches many of the same kind of flags the compiler already supports. It does what it says: cancels out -pedantic. One discrepancy is that if one specifies --no-pedantic and -Weverything or -Wpedantic the pedantic warnings are still enabled (essentially the -W flags win). We can debate the correct behavior here. Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp that determine whether to include the "-pedantic" flag in the warning output. This is no longer needed, as all extensions now have a -W flag. This patch also significantly reduces the number of warnings not under flags from 229 to 158 (all extension warnings). That's a 31% reduction. llvm-svn: 159875
* Add a warning flag for "'extern' variable has an initializer".Matt Beaumont-Gay2012-07-021-2/+1
| | | | llvm-svn: 159600
* Add warning flag -Winvalid-pp-token for preprocessing-tokens which haveRichard Smith2012-06-281-3/+1
| | | | | | | | undefined behaviour, and move the diagnostic for '' from an Error into an ExtWarn in this group. This is important for some users of the preprocessor, and is necessary for gcc compatibility. llvm-svn: 159335
* objc: adds diagnostic group to several old objc warnings.Fariborz Jahanian2012-06-261-7/+1
| | | | | | // rdar://11741435 pr13184 llvm-svn: 159213
* Minor improvements to some C99 variadic-macro-related diagnostics.Richard Smith2012-06-221-4/+1
| | | | llvm-svn: 159054
* [diagtool] Write to llvm::outs() by default instead of llvm::errs()Jordan Rose2012-06-221-1/+1
| | | | llvm-svn: 158954
* Add pedantic warning -Wempty-translation-unit (C11 6.9p1).Jordan Rose2012-06-061-2/+1
| | | | | | | | | | | | | | | | | | | In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> llvm-svn: 158085
* Move the warnings for extra semi-colons under -Wextra-semi. Also, addedRichard Trieu2012-05-161-4/+1
| | | | | | | | a warning for an extra semi-colon after function definitions. Added logic so that a block of semi-colons on a line will only get one warning instead of a warning for each semi-colon. llvm-svn: 156934
* Put the availability warnings in a group.Rafael Espindola2012-05-061-4/+1
| | | | llvm-svn: 156261
* Place several uncovered warnings under warning flags, and tweak diagnostic ↵Ted Kremenek2012-05-011-5/+1
| | | | | | output including the term "gc" (in lowercase). llvm-svn: 155892
* Move warn_cxx0x_right_shift_in_template_arg to CXX11Compat group, fromDouglas Gregor2012-05-011-2/+1
| | | | | | Dmitri Gribenko! llvm-svn: 155872
* Add warning flag for '#import is a language extension', -W#import-pedantic.Ted Kremenek2012-03-161-2/+1
| | | | | | | Don't know if it is an anathema to include '#' in the warning name. I'm fine with changing it, but this was the most obvious name. llvm-svn: 152886
* Move int<->pointer conversion warnings behind -Wint-conversions.Nico Weber2012-03-021-3/+1
| | | | | | | This is consistent with -Wbool-conversion. Let me know if you prefer a different flag name. llvm-svn: 151934
* Reapply r151638 and r151641.James Molloy2012-02-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation. These are now fixed, with regression tests added to catch them both (not Darwin-specific). Original log: ==================== Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. ==================== llvm-svn: 151712
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. llvm-svn: 151667
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-281-2/+1
| | | | | | | | | | | | | | | function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. llvm-svn: 151638
* Support GCC's bug^Wextension allowing class array members to be initalized by aRichard Smith2012-02-151-2/+1
| | | | | | parenthesized braced-init-list in the base/member initialization list. llvm-svn: 150625
* Remove unused diagnostics from include/clang/Basic/Diagnostic*.td files.Dmitri Gribenko2012-02-131-9/+1
| | | | llvm-svn: 150409
OpenPOWER on IntegriCloud