This is an archive of the discontinued LLVM Phabricator instance.

Replace enum types in variadic functions by build-in types.
ClosedPublic

Authored by sfantao on Jul 15 2016, 3:32 PM.

Details

Summary

When compiling the runtime library with clang we get warnings like:

error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
    va_start( args, id );
                    ^
note: parameter of type 'kmp_i18n_id_t' (aka 'kmp_i18n_id') is declared here
    kmp_i18n_id_t id,

My understanding is that the va_start macro only gets the promoted type so it won't know what was the exact type of the argument, which can potentially not work for some targets given that the implementation of the the calling convention could not be done properly.

This patch fixes that by using a built-in type in the function signature.

Diff Detail

Event Timeline

sfantao updated this revision to Diff 64200.Jul 15 2016, 3:32 PM
sfantao retitled this revision from to Replace enum types in variadic functions by build-in types..
sfantao updated this object.
sfantao updated this object.
AndreyChurbanov accepted this revision.Jul 20 2016, 8:34 AM
AndreyChurbanov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 20 2016, 8:34 AM
sfantao closed this revision.Jul 22 2016, 9:13 AM