[x86/Linux] Fix all paths through this function will call itself (dotnet/coreclr...
authorSaeHie Park <saehie.park@gmail.com>
Mon, 5 Dec 2016 08:04:41 +0000 (17:04 +0900)
committerJan Kotas <jkotas@microsoft.com>
Mon, 5 Dec 2016 08:04:41 +0000 (00:04 -0800)
Fix compile error for x86/Linux
- disable "infinite-recursion" for "recursiveFtn" function
- only for clang

Commit migrated from https://github.com/dotnet/coreclr/commit/7200e78258623eb889a46aa7a90818046bd1957d

src/coreclr/src/vm/i386/gmsx86.cpp

index a7afcb9..d4b2c0a 100644 (file)
@@ -49,10 +49,19 @@ static int __stdcall zeroFtn() {
     return 0;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Winfinite-recursion"
+#endif
+
 static int __stdcall recursiveFtn() {
     return recursiveFtn()+1;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 #pragma optimize("", on )