tests/cc: Fix 0225-func.c pointer type - scc - simple c99 compiler (HTM) git clone git://git.simple-cc.org/scc (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules (DIR) README (DIR) LICENSE --- (DIR) commit 7541da3df27d27b30d7639c25dfbd0c192ddbd91 (DIR) parent 9f372e48c6cfbe30974069e3343a856135e43a47 (HTM) Author: Michael Forney <mforney@mforney.org> Date: Sat, 13 Apr 2024 12:51:44 -0700 tests/cc: Fix 0225-func.c pointer type According to C99 6.4.2.2p1, __func__ is declared as array of const char, so when used as an initializer, it is converted to const char *. An initializer for a scalar follows the same type constraints as simple assignment, which for pointers requires that both are to compatible types, and char and const char are not compatible since the have different qualifiers. Diffstat: M tests/cc/execute/0225-func.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- (DIR) diff --git a/tests/cc/execute/0225-func.c b/tests/cc/execute/0225-func.c @@ -1,7 +1,7 @@ int main(void) { - char *p = __func__; + const char *p = __func__; int i; for (i = 0; i < sizeof(__func__); i++) {