)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"400667049709e8a1df37408a90bdba11f006109a","unresolved":true,"context_lines":[{"line_number":7,"context_line":"riscv: riscv_reg: simplify register name allocation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Replace the functions:"},{"line_number":10,"context_line":"- init_reg_name() with strdup()"},{"line_number":11,"context_line":"- init_reg_name_with_prefix() with alloc_printf()"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Keep the same log in case of allocation failure, while dropping"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"0ea5d141_6c0e2679","line":10,"updated":"2026-07-23 09:00:21.000000000","message":"AFAIR, the reason for not using `strdup()` in the original code is that this is not C99 (only merged into C23).\nI\u0027m not opposed to using recent features, though I believe this should be mentioned in `manual/style.txt`.","commit_id":"49bb8ab507633aedeaca8ff0926a7786f636f8ab"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"abd5aca705a5df461e76e368e703f0f4fdf9b151","unresolved":true,"context_lines":[{"line_number":7,"context_line":"riscv: riscv_reg: simplify register name allocation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Replace the functions:"},{"line_number":10,"context_line":"- init_reg_name() with strdup()"},{"line_number":11,"context_line":"- init_reg_name_with_prefix() with alloc_printf()"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Keep the same log in case of allocation failure, while dropping"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"127c0939_ef405f61","line":10,"in_reply_to":"0ea5d141_6c0e2679","updated":"2026-07-23 13:01:09.000000000","message":"Thanks for the review.\nWe have 119 calls to `strdup()` in master branch, which makes hard to replace them all.\n\nAgree we should mention it in the style guide.\n\nIn configure.ac we have since 2009\n`AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).])`\nto prevent compile error for implicit definition of `strndup()` and similar.\nThis macro opens the door to wider GNU extensions, mostly covered by POSIX but not by C99.\n\nBy compiling OpenOCD without _GNU_SOURCE and with -std\u003dc99 I hit all the following unavailable stuff:\n- struct addrinfo\n- struct timespec\n- clock_gettime()\n- ffs()\n- fileno()\n- freeaddrinfo()\n- getaddrinfo()\n- getnameinfo()\n- kill()\n- nanosleep()\n- pread()\n- pwrite()\n- realpath()\n- strcasecmp()\n- strdup()\n- strncasecmp()\n- strndup()\n- strnlen()\n- usleep()\n- u_char\n\nplus the GNU/GCC specific\n- asm\n- typeof()\n\nSo we are not really compliant with C99.","commit_id":"49bb8ab507633aedeaca8ff0926a7786f636f8ab"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"05861142d15de854c023ad8b28f769fc7227544f","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"af91dc24_bbf5bed8","updated":"2026-07-23 08:57:21.000000000","message":"Not tested yet. I need to recover my riscv devices.\nIf someone can test it, please add a review. Thanks","commit_id":"49bb8ab507633aedeaca8ff0926a7786f636f8ab"}]}
