Hi Nathan, This patch is a tweak for the C++ part of the type safety enhancement to attribute ifunc committed in r253041. It touches the C++ ifunc tests you added some years ago and I recently broke with the initial commits of the feature. The notable difference between r253041 and this update (other than correcting the type expected to be returned by the resolver for a member function) is issuing the incompatibility warning under -Wincompatible- pointer-types rather than -Wattributes. When you and/or Jason have a minute, can you please review it?
https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01603.html Thanks Martin On 09/24/2017 07:03 PM, Martin Sebor wrote:
r253041 enhanced type checking for alias and ifunc attributes to detect declarations of incompatible aliases, or ifunc resolvers that return pointers to functions of an incompatible type. More extensive testing exposed a bug in the implementation of the ifunc attribute handling in C++ where the checker expected the ifunc resolver to return a pointer to a member function when the implementation actually expects it return a pointer to a non- member function. In a discussion of the test suite failures, Jakub also suggested to break the enhanced warning out of -Wattributes and issue it under a different option. The attached patch corrects the C++ problem and moves the warning under -Wincompatible-pointer-types. Since this is a C-only option, the patch also enables for it C++. Since the option is enabled by default, the patch further requires -Wextra to issue the warning for ifunc resolvers returning void*. However, the patched checker diagnoses other incompatibilities without it. Martin