Skip to content

tests: constify, make consts static #17736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Jun 24, 2025

  • lib509: constify an input string.
  • add static to const data, where missing.
  • tool1394: fix indentation.

@vszakats
Copy link
Member Author

wat?:

/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:219:10: error: Initialized va_list is leaked [clang-analyzer-valist.Unterminated,-warnings-as-errors]
  219 |   return TRUE;
      |          ^
../../lib/curl_setup_once.h:273:14: note: expanded from macro 'TRUE'
  273 | #define TRUE true
      |              ^
/usr/lib/llvm-18/lib/clang/18/include/stdbool.h:21:14: note: expanded from macro 'true'
   21 | #define true 1
      |              ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:178:14: note: Assuming 'i' is < 'len'
  178 |   for(i = 0; i < len; i++) {
      |              ^~~~~~~
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:178:3: note: Loop condition is true.  Entering loop body
  178 |   for(i = 0; i < len; i++) {
      |   ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:179:8: note: Assuming field 'show' is not equal to 0
  179 |     if(!ctx->show) {
      |        ^~~~~~~~~~
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:179:5: note: Taking false branch
  179 |     if(!ctx->show) {
      |     ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:188:8: note: Assuming field 'show' is equal to 1
  188 |     if(ctx->show == 1) {
      |        ^~~~~~~~~~~~~~
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:188:5: note: Taking true branch
  188 |     if(ctx->show == 1) {
      |     ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:191:7: note: Taking true branch
  191 |       if(!memcmp(ctx->rbuf, ctx->arg, ctx->flen)) {
      |       ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:193:9: note: Initialized va_list
  193 |         fputs(&ctx->arg[1], stdout);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:196:7: note:  Execution continues on line 178
  196 |       continue;
      |       ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:178:14: note: Assuming 'i' is >= 'len'
  178 |   for(i = 0; i < len; i++) {
      |              ^~~~~~~
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:178:3: note: Loop condition is false. Execution continues on line 219
  178 |   for(i = 0; i < len; i++) {
      |   ^
/home/runner/work/curl/curl/bld/src/../../src/tool_help.c:219:10: note: Initialized va_list is leaked
  219 |   return TRUE;
      |          ^
../../lib/curl_setup_once.h:273:14: note: expanded from macro 'TRUE'
  273 | #define TRUE true
      |              ^
/usr/lib/llvm-18/lib/clang/18/include/stdbool.h:21:14: note: expanded from macro 'true'
   21 | #define true 1
      |              ^
make[1]: *** [Makefile:2850: tidy] Error 1

https://github.com/curl/curl/actions/runs/15853995045/job/44694496861?pr=17736#step:33:646

@vszakats
Copy link
Member Author

vszakats commented Jun 24, 2025

A bit-flip? it ran fine the second time ¯\(ツ)/¯:
https://github.com/curl/curl/actions/runs/15853995045/job/44696006274?pr=17736#step:33:597

@vszakats vszakats changed the title lib509: constify tests: constify, make consts static Jun 25, 2025
@vszakats vszakats closed this in 1ec0da0 Jun 25, 2025
@vszakats vszakats deleted the t509-constidy branch June 25, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant