[cfe-commits] [PATCH] Warn on non-compatible returns from extern "C" functions

Eli Friedman eli.friedman at gmail.com
Mon Feb 6 14:33:39 PST 2012


On Sun, Feb 5, 2012 at 9:31 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> MSVC will warn the user when a declared return type of an extern "C"
> function is not C-compatible
> (http://msdn.microsoft.com/en-us/library/1e02627y(v=vs.100).aspx).
> This patch adds the same style of warning to clang, under the
> -Wreturn-type group, with test cases.
>
> Is there a better way for me to check whether a type is "C compatible?"

CXXRecordDecl::isCLike was added recently... not sure if it's what you want.


"UDT" is not a term we use anywhere in clang; please don't use it here.

That said, I really don't understand the point of this warning.

-Eli



More information about the cfe-commits mailing list