Skip to content

Commit fd4efec

Browse files
authored
[mlir] Fix warning due to non ISO standard __FUNCTION__ usage (#91851)
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 ```
1 parent b5f4210 commit fd4efec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/test/CAPI/transform_interpreter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <stdlib.h>
1919

2020
int testApplyNamedSequence(MlirContext ctx) {
21-
fprintf(stderr, "%s\n", __FUNCTION__);
21+
fprintf(stderr, "%s\n", __func__);
2222

2323
const char module[] =
2424
"module attributes {transform.with_named_sequence} {"

0 commit comments

Comments
 (0)