summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2017-12-22 16:40:26 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2017-12-22 16:40:26 +0000
commit25aa3ec1c500c6bb20252bec4878f929649b1957 (patch)
tree8445444af8f467e3d693de0ba2db7d37706329df
parentccdac23ab26d65353131ca6134327b2581537d52 (diff)
downloadbcm5719-llvm-25aa3ec1c500c6bb20252bec4878f929649b1957.tar.gz
bcm5719-llvm-25aa3ec1c500c6bb20252bec4878f929649b1957.zip
Remove unused positional argument for printf
The format string for hints only prints the second argument (string) and drops the first argument (hint id). Depending on how you read the POSIX text for printf, this could be valid. But for practical reason, i.e., unpacking the va_list passed to printf based on the formating information, it makes sense to fix the implementation and not pass the id for hint. Failing testcases were: misc_bugs/teams-reduction.c ompt/parallel/not_enough_threads.c Differential Revision: https://reviews.llvm.org/D41504 llvm-svn: 321361
-rw-r--r--openmp/runtime/src/i18n/en_US.txt2
-rw-r--r--openmp/runtime/src/kmp_i18n.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/openmp/runtime/src/i18n/en_US.txt b/openmp/runtime/src/i18n/en_US.txt
index d3906214aba..eb7a4f6d8aa 100644
--- a/openmp/runtime/src/i18n/en_US.txt
+++ b/openmp/runtime/src/i18n/en_US.txt
@@ -115,7 +115,7 @@ Info "OMP: Info #%1$d: %2$s\n"
Warning "OMP: Warning #%1$d: %2$s\n"
Fatal "OMP: Error #%1$d: %2$s\n"
SysErr "OMP: System error #%1$d: %2$s\n"
-Hint "OMP: Hint: %2$s\n"
+Hint "OMP: Hint %1$s\n"
Pragma "%1$s pragma (at %2$s:%3$s():%4$s)"
# %1 is pragma name (like "parallel" or "master",
diff --git a/openmp/runtime/src/kmp_i18n.cpp b/openmp/runtime/src/kmp_i18n.cpp
index 5105a88dc6b..40ec1f071d5 100644
--- a/openmp/runtime/src/kmp_i18n.cpp
+++ b/openmp/runtime/src/kmp_i18n.cpp
@@ -823,13 +823,15 @@ void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, va_list args) {
switch (message.type) {
case kmp_mt_hint: {
format = kmp_i18n_fmt_Hint;
+ // we cannot skip %1$ and only use %2$ to print the message without the number
+ fmsg = __kmp_msg_format(format, message.str);
} break;
case kmp_mt_syserr: {
format = kmp_i18n_fmt_SysErr;
+ fmsg = __kmp_msg_format(format, message.num, message.str);
} break;
default: { KMP_DEBUG_ASSERT(0); }
}
- fmsg = __kmp_msg_format(format, message.num, message.str);
__kmp_str_free(&message.str);
__kmp_str_buf_cat(&buffer, fmsg.str, fmsg.len);
__kmp_str_free(&fmsg.str);
OpenPOWER on IntegriCloud