From 6478a36b6676a913da3c47e2dd9abff4ccc70c43 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 16 Oct 2024 12:14:52 +0200 Subject: [PATCH] src: guard for double declaration of `curl_ca_embed` in unity builds Seen with curl-for-win linux-musl-from-mac build with gcc 9.2.0. ``` n file included from /Users/runner/work/curl-for-win/curl-for-win/curl/_x64-linux-musl-bld/src/CMakeFiles/curl.dir/Unity/unity_0_c.c:136: /Users/runner/work/curl-for-win/curl-for-win/curl/_x64-linux-musl-bld/src/tool_ca_embed.c:4:28: warning: redundant redeclaration of 'curl_ca_embed' [-Wredundant-decls] 4 | extern const unsigned char curl_ca_embed[]; | ^~~~~~~~~~~~~ In file included from /Users/runner/work/curl-for-win/curl-for-win/curl/_x64-linux-musl-bld/src/CMakeFiles/curl.dir/Unity/unity_0_c.c:88: /Users/runner/work/curl-for-win/curl-for-win/curl/src/tool_operate.c:107:28: note: previous declaration of 'curl_ca_embed' was here 107 | extern const unsigned char curl_ca_embed[]; | ^~~~~~~~~~~~~ ``` https://github.com/curl/curl-for-win/actions/runs/11192203640/job/31116070669#step:3:4894 Follow-up to 8a3740bc8e558b9a9d4a652b74cf27a0961d7010 #14059 Closes #15307 --- src/mk-file-embed.pl | 5 +++++ src/tool_operate.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/mk-file-embed.pl b/src/mk-file-embed.pl index 3447aa9472..e4dbe35de1 100755 --- a/src/mk-file-embed.pl +++ b/src/mk-file-embed.pl @@ -29,11 +29,16 @@ if($ARGV[0] eq "--var") { $varname = shift @ARGV; } +my $varname_upper = uc($varname); + print <