diff options
author | Elliott Hughes <enh@google.com> | 2018-02-28 11:29:45 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-02-28 12:37:28 -0800 |
commit | 9076b0c4e78e8680ce40ce48321e8ab81a87705b (patch) | |
tree | 180da47f5ec09a0d6710feae9868aad5e33abc1e /linker/linker_config.cpp | |
parent | bf6c0c8eaf755f5d1686b5022ee4c6d9eaf68686 (diff) | |
download | bionic-9076b0c4e78e8680ce40ce48321e8ab81a87705b.tar.gz |
Be clearer about linker warnings.
Explicitly say "warning" for warnings, explicitly say what action
we're going to take (such as "(ignoring)"), always provide a link to
our documentation when there is one, explicitly say what API level the
behavior changes at, and explicitly say why we're allowing the misbehavior
for now.
Bug: http://b/71852862
Test: ran tests, looked at logcat
Change-Id: I1795a5af45deb904332b866d7d666690dae4340b
Diffstat (limited to 'linker/linker_config.cpp')
-rw-r--r-- | linker/linker_config.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp index 83c2f36a1..c00b73407 100644 --- a/linker/linker_config.cpp +++ b/linker/linker_config.cpp @@ -194,14 +194,14 @@ static bool parse_config_file(const char* ld_config_file_path, std::string section_name; - while(true) { + while (true) { std::string name; std::string value; std::string error; int result = cp.next_token(&name, &value, &error); if (result == ConfigParser::kError) { - DL_WARN("error parsing %s:%zd: %s (ignoring this line)", + DL_WARN("%s:%zd: warning: couldn't parse %s (ignoring this line)", ld_config_file_path, cp.lineno(), error.c_str()); @@ -214,7 +214,7 @@ static bool parse_config_file(const char* ld_config_file_path, if (result == ConfigParser::kPropertyAssign) { if (!android::base::StartsWith(name, "dir.")) { - DL_WARN("error parsing %s:%zd: unexpected property name \"%s\", " + DL_WARN("%s:%zd: warning: unexpected property name \"%s\", " "expected format dir.<section_name> (ignoring this line)", ld_config_file_path, cp.lineno(), @@ -228,7 +228,7 @@ static bool parse_config_file(const char* ld_config_file_path, } if (value.empty()) { - DL_WARN("error parsing %s:%zd: property value is empty (ignoring this line)", + DL_WARN("%s:%zd: warning: property value is empty (ignoring this line)", ld_config_file_path, cp.lineno()); continue; @@ -275,7 +275,7 @@ static bool parse_config_file(const char* ld_config_file_path, if (result == ConfigParser::kPropertyAssign) { if (properties->find(name) != properties->end()) { - DL_WARN("%s:%zd: warning: property \"%s\" redefinition", + DL_WARN("%s:%zd: warning: redefining property \"%s\" (overriding previous value)", ld_config_file_path, cp.lineno(), name.c_str()); @@ -284,7 +284,7 @@ static bool parse_config_file(const char* ld_config_file_path, (*properties)[name] = PropertyValue(std::move(value), cp.lineno()); } else if (result == ConfigParser::kPropertyAppend) { if (properties->find(name) == properties->end()) { - DL_WARN("%s:%zd: warning: appending to property \"%s\" which isn't defined", + DL_WARN("%s:%zd: warning: appending to undefined property \"%s\" (treating as assignment)", ld_config_file_path, cp.lineno(), name.c_str()); @@ -299,7 +299,7 @@ static bool parse_config_file(const char* ld_config_file_path, value = ":" + value; (*properties)[name].append_value(std::move(value)); } else { - DL_WARN("%s:%zd: warning: += isn't allowed to property \"%s\". Ignoring.", + DL_WARN("%s:%zd: warning: += isn't allowed for property \"%s\" (ignoring)", ld_config_file_path, cp.lineno(), name.c_str()); @@ -308,7 +308,7 @@ static bool parse_config_file(const char* ld_config_file_path, } if (result == ConfigParser::kError) { - DL_WARN("error parsing %s:%zd: %s (ignoring this line)", + DL_WARN("%s:%zd: warning: couldn't parse %s (ignoring this line)", ld_config_file_path, cp.lineno(), error.c_str()); |