timvideos / HDMI2USB-litex-firmware

A version of the HDMI2USB firmware based around LiteX tools produced by @Enjoy-Digital (based on misoc+migen created by @M-Labs)
https://hdmi2usb.tv
BSD 2-Clause "Simplified" License
145 stars 71 forks source link

firmware: Fix unused-var and type mismatch error in recent gcc (7+). #448

Closed cr1901 closed 6 years ago

cr1901 commented 6 years ago

When compiling the HDMI2USB firmware w/ recent gcc versions (I first noticed them in 7+), the build would error out in pll.c and ci.c. These are my proposed fixes.

The pll.c workaround (void) pll_config10x[0]; is a no-op that makes gcc (and probably other C compilers) treat a variable as used. -Werror=unused-const-variable is enabled, and since it's a conditional compile for now that determines whether pll_config10x[0] actually gets used, I think this is a better solution until the S6 issues get worked out.

The ci.c fix was attempting to compare a char * to a char literal, and I believe that to be a genuine bug. :)

mithro commented 6 years ago

@cr1901 Any idea why we are not seeing this issue on Travis now I have rolled the latest GCC?

cr1901 commented 6 years ago

No, I haven't a clue. Perhaps GCC's warnings got less pessimistic?

mithro commented 6 years ago

It seems like this pull request has already been merged. I'm going to close it.