Opened 3 years ago

Last modified 13 months ago

#21494 new defect

Fix scan-build warnings about assigning to char**

Reported by: teor Owned by:
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Minor Keywords: clang scan-build technical-debt c-standard
Cc: Actual Points:
Parent ID: #30225 Points: 0.2
Reviewer: Sponsor:

Description (last modified by teor)

scan-build complains about:

const char **argv; /* cli arguments */
argv = tor_calloc(args_n, sizeof(char *));


process_environment_t *env = tor_malloc_zero(sizeof(process_environment_t));
env->unixoid_environment_block = tor_calloc(n_env_vars + 1, sizeof(char *));

This is fine, and maybe there's a cast or magic comment we could use to make the warnings go away.

Child Tickets

Change History (4)

comment:1 Changed 3 years ago by teor

Description: modified (diff)

comment:2 Changed 3 years ago by nickm

Keywords: technical-devt c-standard added

comment:3 Changed 3 years ago by nickm

Keywords: technical-debt added; technical-devt removed

comment:4 Changed 13 months ago by teor

Parent ID: #30225
Note: See TracTickets for help on using tickets.