)]}'
{"id":"openocd~master~I164da7165c77f232ae83f6d60305360a87c7604a","project":"openocd","branch":"master","attention_set":{"1000853":{"account":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"last_update":"2026-03-16 06:57:54.000000000","reason":"\u003cGERRIT_ACCOUNT_1001667\u003e replied on the change","reason_account":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"}},"1001803":{"account":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"last_update":"2026-03-23 10:41:02.000000000","reason":"\u003cGERRIT_ACCOUNT_1001667\u003e replied on the change","reason_account":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"}}},"removed_from_attention_set":{"1001667":{"account":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"last_update":"2026-03-23 10:41:02.000000000","reason":"\u003cGERRIT_ACCOUNT_1001667\u003e replied on the change","reason_account":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"}}},"hashtags":[],"change_id":"I164da7165c77f232ae83f6d60305360a87c7604a","subject":"helper/replacements: Fix Windows build using clang (-Wsign-compare)","status":"NEW","created":"2026-03-12 13:33:24.000000000","updated":"2026-03-23 10:41:02.000000000","submit_type":"CHERRY_PICK","mergeable":true,"submittable":false,"total_comment_count":5,"unresolved_comment_count":1,"has_review_started":true,"meta_rev_id":"0688dc47b111d4b113e81d8743ff13c1b7c2a209","_number":9506,"owner":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},{"tag":"autogenerated:jenkins-gerrit-trigger","value":1,"date":"2026-03-12 16:14:08.000000000","permitted_voting_range":{"min":-1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"recommended":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"all":[{"value":1,"date":"2026-03-23 10:37:24.000000000","permitted_voting_range":{"min":-1,"max":1},"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","value":1,"default_value":0}},"removable_reviewers":[],"reviewers":{"CC":[{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"}],"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2026-03-12 13:33:33.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"CC"},{"updated":"2026-03-12 13:34:49.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2026-03-13 09:15:02.000000000","updated_by":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"reviewer":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"state":"CC"},{"updated":"2026-03-23 10:37:24.000000000","updated_by":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"reviewer":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"state":"REVIEWER"}],"messages":[{"id":"2e21ba8c0f154d1d72739c4512564013f5cd848b","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-12 13:33:24.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"4e0cdaf8a70c804ef9b29ddf2e636e68ad3647fe","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-03-12 13:34:49.000000000","message":"Patch Set 1: Verified-1\n\nBuild Failed \n\nhttps://build.openocd.org/job/openocd-gerrit-build/21980/ : FAILURE\n\nhttps://build.openocd.org/job/openocd-gerrit/22876/ : FAILURE","accounts_in_message":[],"_revision_number":1},{"id":"fa131b81e3ab59a113543f094017bd9986084d49","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-12 13:48:11.000000000","message":"Uploaded patch set 2.\n\nOutdated Votes:\n* Verified-1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":2},{"id":"d6897030f9c3fbbaa52f1f320e1622b3c750ffff","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-12 13:56:16.000000000","message":"Uploaded patch set 3.","accounts_in_message":[],"_revision_number":3},{"id":"16f9593f86be44fa1d335c7d2d563971f5699b08","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-03-12 13:56:20.000000000","message":"Patch Set 2: Verified-1\n\nBuild Failed \n\nhttps://build.openocd.org/job/openocd-gerrit-build/21981/ : ABORTED\n\nhttps://build.openocd.org/job/openocd-gerrit/22877/ : SUCCESS","accounts_in_message":[],"_revision_number":2},{"id":"17e73f819456c50d2c113dce030f05521a59f7ad","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-12 14:41:18.000000000","message":"Uploaded patch set 4.","accounts_in_message":[],"_revision_number":4},{"id":"bfedfdec19b74636a9a0493494bfc455e77afabe","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-03-12 14:41:25.000000000","message":"Patch Set 3: Verified-1\n\nBuild Failed \n\nhttps://build.openocd.org/job/openocd-gerrit-build/21982/ : ABORTED\n\nhttps://build.openocd.org/job/openocd-gerrit/22878/ : SUCCESS","accounts_in_message":[],"_revision_number":3},{"id":"66d5cdb6ff1b8166f1a39ae1acb837c0a013b245","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-03-12 16:14:08.000000000","message":"Patch Set 4: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit-build/21983/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit/22879/ : SUCCESS","accounts_in_message":[],"_revision_number":4},{"id":"613db0aedf0cee7d25fe65c6bc28805872901081","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-13 09:15:02.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"2e65b99842b0e18ac38a8ed04bf6fadeba417603","author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"real_author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"date":"2026-03-13 18:31:48.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"1cc921623df86712980bd8a40bc0b9551441ce36","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-16 06:57:54.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"e47e825fd9c324f7a0121e13f20262a1c9ee5829","author":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"real_author":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"date":"2026-03-23 10:37:24.000000000","message":"Patch Set 4: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"0688dc47b111d4b113e81d8743ff13c1b7c2a209","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2026-03-23 10:41:02.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4}],"current_revision":"636f43d28aca8d49b9b7c81d4cafdc27aab5b302","revisions":{"636f43d28aca8d49b9b7c81d4cafdc27aab5b302":{"kind":"REWORK","_number":4,"created":"2026-03-12 14:41:18.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/06/9506/4","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/06/9506/4","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/4 \u0026\u0026 git checkout -b change-9506 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/06/9506/4","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/4 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e4c49d86052dfc241ec60bbd3b7e190307891722","subject":"server/server: Fix build on FreeBSD"}],"author":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:07:32.000000000","tz":60},"committer":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 14:41:03.000000000","tz":60},"subject":"helper/replacements: Fix Windows build using clang (-Wsign-compare)","message":"helper/replacements: Fix Windows build using clang (-Wsign-compare)\n\nOpenOCD currently won\u0027t build on Windows using clang for these\nreasons:\n- \"-Wextra\", which is enabled for OpenOCD builds by default,\n  causes on clang that \"-Wsign-compare\" gets also enabled.\n- Socket descriptors on Windows are signed, causing\n  -Wsign-compare warnings on each invocation of FD_SET.\n\nPossible workaround: ./configure [...] --disable-werror\n\nFix the issue by creating OCD_FD_* wrapper macros over FD_*\nthat add the missing cast on Windows, silencing those compiler\nwarnings.\n\nAlso make sure that -Wsign-compare gets enabled on GCC.\n\nSteps to reproduce the issue:\n\n1) Use a Windows machine\n2) Download and install MSYS2 from: https://www.msys2.org\n3) In the MSYS2 shell, install the following packages:\n\n   pacman -S autotools automake base-devel mingw-w64-x86_64-clang git tcl\n\n4) Clone libjaylink source\n\n   git clone https://github.com/openocd-org/openocd.git --recursive\n   cd openocd\n\n5) Configure and build openocd\n\n   export CC\u003d/mingw64/bin/clang\n   ./bootstrap\n   ./configure \\\n       --enable-jtag_vpi \\\n       --enable-remote-bitbang \\\n       --prefix\u003d`pwd`/install \\\n       --enable-internal-jimtcl\n   make -j$(nproc)\n\n6) Observe the sign-compare error message(s) produced by clang,\n   for example:\n\nsrc/helper/replacements.c:178:6: error: comparison of integers\nof different signs: \u0027SOCKET\u0027 (aka \u0027unsigned long long\u0027) and\n\u0027int\u0027 [-Werror,-Wsign-compare]\n  178 |  FD_SET(i, \u0026sock_read);\n      |  ^~~~~~~~~~~~~~~~~~~~~\nC:/msys64/mingw64/include/psdk_inc/_fd_types.h:77:40:\nnote: expanded from macro \u0027FD_SET\u0027\n   77 | if (((fd_set *)(set))-\u003efd_array[__i] \u003d\u003d (fd)) {         \\\n      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~\n\n$ clang --version\nclang version 21.1.7\nTarget: x86_64-w64-windows-gnu\nThread model: posix\nInstalledDir: C:/msys64/mingw64/bin\n\nChange-Id: I164da7165c77f232ae83f6d60305360a87c7604a\nSigned-off-by: Jan Matyas \u003cjan.matyas@codasip.com\u003e\n"}},"4ce3fc1c994e0ff074597b269ad3e7d93b54730c":{"kind":"REWORK","_number":1,"created":"2026-03-12 13:33:24.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/06/9506/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/06/9506/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/1 \u0026\u0026 git checkout -b change-9506 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/06/9506/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e4c49d86052dfc241ec60bbd3b7e190307891722","subject":"server/server: Fix build on FreeBSD"}],"author":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:07:32.000000000","tz":60},"committer":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:25:08.000000000","tz":60},"subject":"helper/replacements: Fix Windows build using clang (-Wsign-compare)","message":"helper/replacements: Fix Windows build using clang (-Wsign-compare)\n\nOpenOCD currently won\u0027t build on Windows using clang for these\nreasons:\n- \"-Wextra\", which is enabled for OpenOCD builds by default,\n  causes on clang that \"-Wsign-compare\" gets also enabled.\n- Socket descriptors on Windows are signed, causing\n  -Wsign-compare warnings on each invocation of FD_SET.\n\nPossible workaround: ./configure [...] --disable-werror\n\nFix the issue by creating OCD_FD_* wrapper macros over FD_*\nthat add the missing cast on Windows, silencing those compiler\nwarnings.\n\nAlso make sure that -Wsign-compare gets enabled on GCC.\n\nSteps to reproduce the issue:\n\n1) Use a Windows machine\n2) Download and install MSYS2 from: https://www.msys2.org\n3) In the MSYS2 shell, install the following packages:\n\n   pacman -S autotools automake base-devel mingw-w64-x86_64-clang git tcl\n\n4) Clone libjaylink source\n\n   git clone https://github.com/openocd-org/openocd.git --recursive\n   cd openocd\n\n5) Configure and build openocd\n\n   export CC\u003d/mingw64/bin/clang\n   ./bootstrap\n   ./configure \\\n       --enable-jtag_vpi \\\n       --enable-remote-bitbang \\\n       --prefix\u003d`pwd`/install \\\n       --enable-internal-jimtcl\n   make -j$(nproc)\n\n6) Observe the sign-compare error message(s) produced by clang,\n   for example:\n\nsrc/helper/replacements.c:178:6: error: comparison of integers\nof different signs: \u0027SOCKET\u0027 (aka \u0027unsigned long long\u0027) and\n\u0027int\u0027 [-Werror,-Wsign-compare]\n  178 |  FD_SET(i, \u0026sock_read);\n      |  ^~~~~~~~~~~~~~~~~~~~~\nC:/msys64/mingw64/include/psdk_inc/_fd_types.h:77:40:\nnote: expanded from macro \u0027FD_SET\u0027\n   77 | if (((fd_set *)(set))-\u003efd_array[__i] \u003d\u003d (fd)) {         \\\n      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~\n\n$ clang --version\nclang version 21.1.7\nTarget: x86_64-w64-windows-gnu\nThread model: posix\nInstalledDir: C:/msys64/mingw64/bin\n\nChange-Id: I164da7165c77f232ae83f6d60305360a87c7604a\nSigned-off-by: Jan Matyas \u003cjan.matyas@codasip.com\u003e\n"}},"7afd5e12c629fce3a2b4813ca10bce0f742d914c":{"kind":"REWORK","_number":2,"created":"2026-03-12 13:48:11.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/06/9506/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/06/9506/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/2 \u0026\u0026 git checkout -b change-9506 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/06/9506/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e4c49d86052dfc241ec60bbd3b7e190307891722","subject":"server/server: Fix build on FreeBSD"}],"author":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:07:32.000000000","tz":60},"committer":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:47:32.000000000","tz":60},"subject":"helper/replacements: Fix Windows build using clang (-Wsign-compare)","message":"helper/replacements: Fix Windows build using clang (-Wsign-compare)\n\nOpenOCD currently won\u0027t build on Windows using clang for these\nreasons:\n- \"-Wextra\", which is enabled for OpenOCD builds by default,\n  causes on clang that \"-Wsign-compare\" gets also enabled.\n- Socket descriptors on Windows are signed, causing\n  -Wsign-compare warnings on each invocation of FD_SET.\n\nPossible workaround: ./configure [...] --disable-werror\n\nFix the issue by creating OCD_FD_* wrapper macros over FD_*\nthat add the missing cast on Windows, silencing those compiler\nwarnings.\n\nAlso make sure that -Wsign-compare gets enabled on GCC.\n\nSteps to reproduce the issue:\n\n1) Use a Windows machine\n2) Download and install MSYS2 from: https://www.msys2.org\n3) In the MSYS2 shell, install the following packages:\n\n   pacman -S autotools automake base-devel mingw-w64-x86_64-clang git tcl\n\n4) Clone libjaylink source\n\n   git clone https://github.com/openocd-org/openocd.git --recursive\n   cd openocd\n\n5) Configure and build openocd\n\n   export CC\u003d/mingw64/bin/clang\n   ./bootstrap\n   ./configure \\\n       --enable-jtag_vpi \\\n       --enable-remote-bitbang \\\n       --prefix\u003d`pwd`/install \\\n       --enable-internal-jimtcl\n   make -j$(nproc)\n\n6) Observe the sign-compare error message(s) produced by clang,\n   for example:\n\nsrc/helper/replacements.c:178:6: error: comparison of integers\nof different signs: \u0027SOCKET\u0027 (aka \u0027unsigned long long\u0027) and\n\u0027int\u0027 [-Werror,-Wsign-compare]\n  178 |  FD_SET(i, \u0026sock_read);\n      |  ^~~~~~~~~~~~~~~~~~~~~\nC:/msys64/mingw64/include/psdk_inc/_fd_types.h:77:40:\nnote: expanded from macro \u0027FD_SET\u0027\n   77 | if (((fd_set *)(set))-\u003efd_array[__i] \u003d\u003d (fd)) {         \\\n      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~\n\n$ clang --version\nclang version 21.1.7\nTarget: x86_64-w64-windows-gnu\nThread model: posix\nInstalledDir: C:/msys64/mingw64/bin\n\nChange-Id: I164da7165c77f232ae83f6d60305360a87c7604a\nSigned-off-by: Jan Matyas \u003cjan.matyas@codasip.com\u003e\n"}},"a01643c19aaf1e76e131c3ca4a20db7931e80396":{"kind":"REWORK","_number":3,"created":"2026-03-12 13:56:16.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/06/9506/3","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/06/9506/3","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/3 \u0026\u0026 git checkout -b change-9506 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/06/9506/3","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/06/9506/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e4c49d86052dfc241ec60bbd3b7e190307891722","subject":"server/server: Fix build on FreeBSD"}],"author":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:07:32.000000000","tz":60},"committer":{"name":"Jan Matyas","email":"jan.matyas@codasip.com","date":"2026-03-12 13:55:47.000000000","tz":60},"subject":"helper/replacements: Fix Windows build using clang (-Wsign-compare)","message":"helper/replacements: Fix Windows build using clang (-Wsign-compare)\n\nOpenOCD currently won\u0027t build on Windows using clang for these\nreasons:\n- \"-Wextra\", which is enabled for OpenOCD builds by default,\n  causes on clang that \"-Wsign-compare\" gets also enabled.\n- Socket descriptors on Windows are signed, causing\n  -Wsign-compare warnings on each invocation of FD_SET.\n\nPossible workaround: ./configure [...] --disable-werror\n\nFix the issue by creating OCD_FD_* wrapper macros over FD_*\nthat add the missing cast on Windows, silencing those compiler\nwarnings.\n\nAlso make sure that -Wsign-compare gets enabled on GCC.\n\nSteps to reproduce the issue:\n\n1) Use a Windows machine\n2) Download and install MSYS2 from: https://www.msys2.org\n3) In the MSYS2 shell, install the following packages:\n\n   pacman -S autotools automake base-devel mingw-w64-x86_64-clang git tcl\n\n4) Clone libjaylink source\n\n   git clone https://github.com/openocd-org/openocd.git --recursive\n   cd openocd\n\n5) Configure and build openocd\n\n   export CC\u003d/mingw64/bin/clang\n   ./bootstrap\n   ./configure \\\n       --enable-jtag_vpi \\\n       --enable-remote-bitbang \\\n       --prefix\u003d`pwd`/install \\\n       --enable-internal-jimtcl\n   make -j$(nproc)\n\n6) Observe the sign-compare error message(s) produced by clang,\n   for example:\n\nsrc/helper/replacements.c:178:6: error: comparison of integers\nof different signs: \u0027SOCKET\u0027 (aka \u0027unsigned long long\u0027) and\n\u0027int\u0027 [-Werror,-Wsign-compare]\n  178 |  FD_SET(i, \u0026sock_read);\n      |  ^~~~~~~~~~~~~~~~~~~~~\nC:/msys64/mingw64/include/psdk_inc/_fd_types.h:77:40:\nnote: expanded from macro \u0027FD_SET\u0027\n   77 | if (((fd_set *)(set))-\u003efd_array[__i] \u003d\u003d (fd)) {         \\\n      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~\n\n$ clang --version\nclang version 21.1.7\nTarget: x86_64-w64-windows-gnu\nThread model: posix\nInstalledDir: C:/msys64/mingw64/bin\n\nChange-Id: I164da7165c77f232ae83f6d60305360a87c7604a\nSigned-off-by: Jan Matyas \u003cjan.matyas@codasip.com\u003e\n"}}},"requirements":[],"submit_records":[{"rule_name":"gerrit~DefaultSubmitRule","status":"NOT_READY","labels":[{"label":"Verified","status":"OK","applied_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"NEED"}]}],"submit_requirements":[{"name":"Verified","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Verified\u003dMAX -label:Verified\u003dMIN","fulfilled":true,"status":"PASS","passing_atoms":["label:Verified\u003dMAX","-label:Verified\u003dMIN"],"failing_atoms":[]}},{"name":"Code-Review","status":"UNSATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Code-Review\u003dMAX -label:Code-Review\u003dMIN","fulfilled":false,"status":"FAIL","passing_atoms":[],"failing_atoms":["label:Code-Review\u003dMAX","-label:Code-Review\u003dMIN"]}}]}
