This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix incorrect KMP_STRLEN() macro on Windows
ClosedPublic

Authored by jlpeyton on Mar 8 2021, 12:01 PM.

Details

Summary

The second argument to the strnlen_s(str, size) function should be sizeof(str) when str is a true array of characters with known size (instead of just a char*).
Use type traits to determine if first parameter is character array and use the correct size based on that trait.

Diff Detail

Event Timeline

jlpeyton created this revision.Mar 8 2021, 12:01 PM
jlpeyton requested review of this revision.Mar 8 2021, 12:01 PM
This revision is now accepted and ready to land.Mar 15 2021, 11:58 AM
This revision was landed with ongoing or failed builds.Apr 5 2021, 7:03 AM
This revision was automatically updated to reflect the committed changes.