[SeaBIOS] GCC 7.1 warning in `tcgbios.c`: `'hleo.eventnumber' may be used uninitialized in this function`

Paul Menzel pmenzel at molgen.mpg.de
Thu Aug 10 20:52:06 CEST 2017


Dear SeaBIOS folks,


GCC 7.1 warns about a maybe uninitialized struct member.

```
src/tcgbios.c: In function 'tpm_interrupt_handler32':
src/tcgbios.c:1232:30: warning: 'hleo.eventnumber' may be used 
uninitialized in this function [-Wmaybe-uninitialized]
      hleeo->eventnumber = hleo.eventnumber;
                           ~~~~^~~~~~~~~~~~
   Compiling whole program out/ccode32flat.o
In file included from out/ccode32flat.o.tmp.c:52:0:
./src/tcgbios.c: In function 'tpm_interrupt_handler32':
./src/tcgbios.c:1232:30: warning: 'hleo.eventnumber' may be used 
uninitialized in this function [-Wmaybe-uninitialized]
      hleeo->eventnumber = hleo.eventnumber;
                           ~~~~^~~~~~~~~~~~
```

It looks valid, as in the beginning the struct hleo is only declared.

```
1189     struct hleo hleo;
```


Kind regards,

Paul



More information about the SeaBIOS mailing list