This should make it easier to remove those warnings when the compiler
gets smarter. Not sure if I got them all...
Double space before the comment start to make it easier to separate from the
preceding line.
int cg_pid_get_path(const char *controller, pid_t pid, char **ret_path) {
_cleanup_fclose_ FILE *f = NULL;
- const char *fs, *controller_str = NULL; /* silence gcc warning about unitialized variable */
+ const char *fs, *controller_str = NULL; /* avoid false maybe-uninitialized warning */
int unified, r;
assert(pid >= 0);
_cleanup_close_ int fdf = -1;
struct stat st;
- int fdt = -1, r;
+ int r, fdt = -1; /* avoid false maybe-uninitialized warning */
assert(from);
assert(to);
static int write_container_id(void) {
const char *c;
- int r = 0; /* silence gcc warning about r being unitialized below */
+ int r = 0; /* avoid false maybe-uninitialized warning */
c = getenv("container");
if (isempty(c))
}
int main(int argc, char *argv[]) {
- bool run_ambient = false; /* unnecessary initialization to silence gcc warning */
+ bool run_ambient = false; /* avoid false maybe-uninitialized warning */
test_setup_logging(LOG_INFO);