From fd4efecac21d92428d2f804f43e85bdfa460bdd5 Mon Sep 17 00:00:00 2001 From: Kai Sasaki Date: Mon, 13 May 2024 15:31:41 +0900 Subject: [PATCH] [mlir] Fix warning due to non ISO standard __FUNCTION__ usage (#91851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes the warning message due to the non ISO standard usage of `__FUNCTION__` ``` /home/lewuathe/llvm-project/mlir/test/CAPI/transform_interpreter.c: In function ‘testApplyNamedSequence’: /home/lewuathe/llvm-project/mlir/test/CAPI/transform_interpreter.c:21:27: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic] 21 | fprintf(stderr, "%s\n", __FUNCTION__); | ``` As `__FUNCTION__` is another name of `__func__` and it conforms to the specification. We should be able to use `__func__` here. Ref: https://stackoverflow.com/questions/52962812/how-to-silence-gcc-pedantic-wpedantic-warning-regarding-function Compiler ``` Ubuntu clang version 18.1.3 (1) Target: x86_64-pc-linux-gnu ``` --- mlir/test/CAPI/transform_interpreter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/test/CAPI/transform_interpreter.c b/mlir/test/CAPI/transform_interpreter.c index f1ab185e0e21..a849b2f24526 100644 --- a/mlir/test/CAPI/transform_interpreter.c +++ b/mlir/test/CAPI/transform_interpreter.c @@ -18,7 +18,7 @@ #include int testApplyNamedSequence(MlirContext ctx) { - fprintf(stderr, "%s\n", __FUNCTION__); + fprintf(stderr, "%s\n", __func__); const char module[] = "module attributes {transform.with_named_sequence} {"