This is an archive of the discontinued LLVM Phabricator instance.

Remove unused positional argument for printf
ClosedPublic

Authored by protze.joachim on Dec 21 2017, 10:52 AM.

Details

Summary

gcc on Ubuntu compiles by default with -D_FORTIFY_SOURCE=2. This results in a fatal runtime error, when kmp_msg tries to print a hint:

*** invalid %N$ use detected ***

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 are:

misc_bugs/teams-reduction.c
ompt/parallel/not_enough_threads.c

Diff Detail

Repository
rL LLVM

Event Timeline

protze.joachim edited the summary of this revision. (Show Details)
omalyshe accepted this revision.Dec 22 2017, 5:36 AM
omalyshe added a subscriber: omalyshe.

LGTM.
Verified on some other tests in Intel environment.

This revision is now accepted and ready to land.Dec 22 2017, 5:36 AM
This revision was automatically updated to reflect the committed changes.