versioner: extract strict warnings out of -v into its own flag.
Bug: None Test: versioner -v; versioner -s Change-Id: I8f6ac7064c6f05de0811677f7fcfce929a2568c1
This commit is contained in:
parent
338cf12963
commit
acc3d80edf
3 changed files with 14 additions and 7 deletions
|
@ -130,7 +130,7 @@ static std::map<std::string, NdkSymbolType> parsePlatform(const CompilationType&
|
|||
}
|
||||
|
||||
if (result.count(symbol_name) != 0) {
|
||||
if (verbose) {
|
||||
if (strict) {
|
||||
printf("duplicated symbol '%s' in '%s'\n", symbol_name.str().c_str(), file.str().c_str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,8 +57,9 @@
|
|||
using namespace std::chrono_literals;
|
||||
using namespace std::string_literals;
|
||||
|
||||
bool add_include;
|
||||
bool strict;
|
||||
bool verbose;
|
||||
bool add_include;
|
||||
|
||||
static int getCpuCount();
|
||||
static int max_thread_count = getCpuCount();
|
||||
|
@ -389,7 +390,7 @@ static bool checkVersions(const std::set<CompilationType>& types,
|
|||
failed = true;
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
if (strict) {
|
||||
auto extra_it = extra_availability.find(symbol_name);
|
||||
if (extra_it != extra_availability.end()) {
|
||||
printf("%s: declaration marked unavailable but symbol available in [%s]\n",
|
||||
|
@ -429,7 +430,7 @@ static void usage(bool help = false) {
|
|||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "Validation:\n");
|
||||
fprintf(stderr, " -p PATH\tcompare against NDK platform at PATH\n");
|
||||
fprintf(stderr, " -v\t\tenable verbose warnings\n");
|
||||
fprintf(stderr, " -s\t\tenable strict warnings\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "Preprocessing:\n");
|
||||
fprintf(stderr, " -o PATH\tpreprocess header files and emit them at PATH\n");
|
||||
|
@ -438,6 +439,7 @@ static void usage(bool help = false) {
|
|||
fprintf(stderr, "Miscellaneous:\n");
|
||||
fprintf(stderr, " -d\t\tdump function availability\n");
|
||||
fprintf(stderr, " -j THREADS\tmaximum number of threads to use\n");
|
||||
fprintf(stderr, " -v\t\tenable verbose logging\n");
|
||||
fprintf(stderr, " -h\t\tdisplay this message\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -454,7 +456,7 @@ int main(int argc, char** argv) {
|
|||
bool dump = false;
|
||||
|
||||
int c;
|
||||
while ((c = getopt(argc, argv, "a:r:p:vo:fdj:hi")) != -1) {
|
||||
while ((c = getopt(argc, argv, "a:r:p:so:fdj:vhi")) != -1) {
|
||||
default_args = false;
|
||||
switch (c) {
|
||||
case 'a': {
|
||||
|
@ -499,8 +501,8 @@ int main(int argc, char** argv) {
|
|||
break;
|
||||
}
|
||||
|
||||
case 'v':
|
||||
verbose = true;
|
||||
case 's':
|
||||
strict = true;
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
|
@ -527,6 +529,10 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
verbose = true;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
usage(true);
|
||||
break;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
extern bool strict;
|
||||
extern bool verbose;
|
||||
extern bool add_include;
|
||||
|
||||
|
|
Loading…
Reference in a new issue