Inconsistent structure/union declaration (field count mismatch)

An inconsistent data declaration was found.

In this case, the same name was declared as a structure or union in two compilation units, but comparison of the two types failed with a field count mismatch, that is, one structure or union had more fields than the other.

ID

Observation

Description

1

Definition

The first definition

2

Definition

The second definition

Example

file1.c:

typedef struct {
    long long j;
    short int i;
    short int k;
} pw;
pw rec = {1,2,3};

extern pw rec2;

int main(int argc, char **argv)
{
    if (rec.k == rec2.k) return 1;
    return 0;
}
        
file2.c:
          
    typedef struct {
        long long j;
        short int i;
    } pw;

    pw rec2 = {10,12};
        

Copyright © 2010, Intel Corporation. All rights reserved.