Skip to content

We should remove -Werror=shadow from the CFLAGS when we detect we run on an older gcc version #406

@utezduyar

Description

@utezduyar

I am not sure why you guys don't see these errors but I see many shadow errors since we enabled the switch. I started fixing some but then decided to ask first. Is it our compiler acting crazy?

shadow/src/libsystemd/sd-bus/bus-kernel.c: In function 'bus_message_setup_kmsg':
shadow/src/libsystemd/sd-bus/bus-kernel.c:323:33: error: declaration of 'now' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/util.h:47:0,
                 from shadow/src/libsystemd/sd-bus/bus-kernel.c:37:
shadow/src/basic/time-util.h:72:8: error: shadowed declaration is here [-Werror=shadow]


shadow/src/basic/hashmap.c: In function 'get_hash_key':
shadow/src/basic/hashmap.c:386:34: error: declaration of 'hash_key' shadows a global declaration [-Werror=shadow]
shadow/src/basic/hashmap.c:376:17: error: shadowed declaration is here [-Werror=shadow]

shadow/src/basic/rm-rf.c: In function 'rm_rf_children':
shadow/src/basic/rm-rf.c:65:22: error: declaration of 'is_dir' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/rm-rf.c:22:0:
shadow/src/basic/util.h:838:5: error: shadowed declaration is here [-Werror=shadow]

shadow/src/shared/fstab-util.h: In function 'fstab_test_yes_no_option':
shadow/src/shared/fstab-util.h:39:75: error: declaration of 'yes_no' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/shared/generator.c:24:0:
shadow/src/basic/util.h:87:27: error: shadowed declaration is here [-Werror=shadow]

shadow/src/core/device.c: In function 'device_update_found_one':
shadow/src/core/device.c:444:82: error: declaration of 'now' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/util.h:47:0,
                 from shadow/src/basic/hashmap.h:28,
                 from shadow/src/shared/install.h:32,
                 from shadow/src/core/unit.h:36,
                 from shadow/src/core/dbus-device.h:24,
                 from shadow/src/core/device.c:28:
shadow/src/basic/time-util.h:72:8: error: shadowed declaration is here [-Werror=shadow]
shadow/src/core/device.c: In function 'device_update_found_by_sysfs':
shadow/src/core/device.c:476:106: error: declaration of 'now' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/util.h:47:0,
                 from shadow/src/basic/hashmap.h:28,
                 from shadow/src/shared/install.h:32,
                 from shadow/src/core/unit.h:36,
                 from shadow/src/core/dbus-device.h:24,
                 from shadow/src/core/device.c:28:
shadow/src/basic/time-util.h:72:8: error: shadowed declaration is here [-Werror=shadow]
shadow/src/core/device.c: In function 'device_update_found_by_name':
shadow/src/core/device.c:492:104: error: declaration of 'now' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/util.h:47:0,
                 from shadow/src/basic/hashmap.h:28,
                 from shadow/src/shared/install.h:32,
                 from shadow/src/core/unit.h:36,
                 from shadow/src/core/dbus-device.h:24,
                 from shadow/src/core/device.c:28:
shadow/src/basic/time-util.h:72:8: error: shadowed declaration is here [-Werror=shadow]
shadow/src/core/device.c: In function 'device_found_node':
shadow/src/core/device.c:767:87: error: declaration of 'now' shadows a global declaration [-Werror=shadow]
In file included from shadow/src/basic/util.h:47:0,
                 from shadow/src/basic/hashmap.h:28,
                 from shadow/src/shared/install.h:32,
                 from shadow/src/core/unit.h:36,
                 from shadow/src/core/dbus-device.h:24,
                 from shadow/src/core/device.c:28:
shadow/src/basic/time-util.h:72:8: error: shadowed declaration is here [-Werror=shadow]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions