Dead assignment

A value was assigned that was never read.

This error may indicate that the code that was intended to consume this value was deleted or moved to a place that is not reached by this assignment.

ID

Observation

Description

1

Memory write

The dead assignment

Examples


extern int y;

void f()
{
   int x = 1 + y; // dead assignment
   x = 0;
   y = x;
   x = 2; // dead assignment
}
        

Copyright © 2010, Intel Corporation. All rights reserved.