Mentions légales du service

Skip to content

Try harder to find a useful token in the case of deadcode.

LAWALL Julia requested to merge deadcode_message into master

In the case of strange code, the DeadCode warning tries to find a position to report on from the tokens associated with the affected statement. When this statement has its first (or only token) that is a fake token, no position is found. But the tokens found inside the statement would b just as useful for seeing where the problem occurs, so collect them if needed.

The problem was obderved from the following function in net/core/dev.c (Linux commit bfe91da29bfa)

const char *netdev_cmd_to_name(enum netdev_cmd cmd)
{
        case NETDEV_##val:                              \
                return "NETDEV_" __stringify(val);
        switch (cmd) {
        N(UP) N(DOWN) N(REBOOT) N(CHANGE) N(REGISTER) N(UNREGISTER)
        N(CHANGEMTU) N(CHANGEADDR) N(GOING_DOWN) N(CHANGENAME) N(FEAT_CHANGE)
        N(BONDING_FAILOVER) N(PRE_UP) N(PRE_TYPE_CHANGE) N(POST_TYPE_CHANGE)
        N(POST_INIT) N(RELEASE) N(NOTIFY_PEERS) N(JOIN) N(CHANGEUPPER)
        N(RESEND_IGMP) N(PRECHANGEMTU) N(CHANGEINFODATA) N(BONDING_INFO)
        N(PRECHANGEUPPER) N(CHANGELOWERSTATE) N(UDP_TUNNEL_PUSH_INFO)
        N(UDP_TUNNEL_DROP_INFO) N(CHANGE_TX_QUEUE_LEN)
        N(CVLAN_FILTER_PUSH_INFO) N(CVLAN_FILTER_DROP_INFO)
        N(SVLAN_FILTER_PUSH_INFO) N(SVLAN_FILTER_DROP_INFO)
        N(PRE_CHANGEADDR)
        }
        return "UNKNOWN_NETDEV_EVENT";
}
Edited by LAWALL Julia

Merge request reports