Question: I have two applications written in C that include the same header. In this header I have the declaration of a struct. I use the GCC compiler to compile both applications.

When I execute both applications, they produce different values of `sizeof(struct-defined-in-the-header)`.

Why does this happen?

Answer: 
First of all, make sure to do a clean build of everything.

If the problem persists, this could mean that different compilation options have been used for the two translation units. I would capture the `gcc` command lines used for the two compilations, and would compare them, paying particular attention to any options having to do with alignment, structure padding etc.

Another possibility is that the definition of the struct depends on some preprocessor symbols, and the symbols get defined differently for the two translation units. Using `gcc -E` and comparing the struct definition in the two preprocessor outputs would be a good start.
As Doc Brown commented, there are several possibilities. You should show the code. Here's another guess, though.

Maybe another variable is shadowing your `struct` in one of the cases? Like in:

```
extern struct { char foo; } bar;

void baz(void) {
    long bar;
    sizeof bar;  /* will be sizeof(long) */
}

void qux(short bar) {
    sizeof bar;  /* will be sizeof(short) */
}

```