Skip to content

fix compilation issues with GCC < 4.4.6

Gianluca Gennari linux-media 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4adv7842: fix compilation with GCC < 4.4.6drivers/media/i2c/adv7842.c+12 -180 replies
2/4adv7511: fix compilation with GCC < 4.4.6drivers/media/i2c/adv7511.c+7 -90 replies
3/4ad9389b: fix compilation with GCC < 4.4.6drivers/media/i2c/ad9389b.c+6 -90 replies
4/4ths8200: fix compilation with GCC < 4.4.6drivers/media/i2c/ths8200.c+4 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] fix compilation issues with GCC < 4.4.6

With GCC 4.4.3 (Ubuntu 10.04) the compilation of the new adv7842 driver fails with this error:

CC [M] adv7842.o
adv7842.c:549: error: unknown field 'bt' specified in initializer adv7842.c:550: error: field name not in record or union initializer adv7842.c:550: error: (near initialization for 'adv7842_timings_cap_analog.reserved') adv7842.c:551: error: field name not in record or union initializer adv7842.c:551: error: (near initialization for 'adv7842_timings_cap_analog.reserved') adv7842.c:552: error: field name not in record or union initializer adv7842.c:552: error: (near initialization for 'adv7842_timings_cap_analog.reserved') adv7842.c:553: error: field name not in record or union initializer adv7842.c:553: error: (near initialization for 'adv7842_timings_cap_analog.reserved') adv7842.c:553: warning: excess elements in array initializer
...

This is caused by the old GCC version (as explained in file v4l2-dv-timings.h). The proposed fix uses the V4L2_INIT_BT_TIMINGS macro defined there. Please note that we need to init the reserved space as well, as otherwise GCC will fail with another error:

CC [M] adv7842.o
adv7842.c:549: error: field name not in record or union initializer adv7842.c:549: error: (near initialization for 'adv7842_timings_cap_analog.reserved') adv7842.c:549: warning: braces around scalar initializer
adv7842.c:549: warning: (near initialization for 'adv7842_timings_cap_analog.reserved[0]')
...

A proper comment was added as a remainder.

The same issue applies to other drivers too: ths8200, adv7511, ad9389b. The present patch series fixes all of them.

Best regards,
Gianluca

Gianluca Gennari (4):
adv7842: fix compilation with GCC < 4.4.6
adv7511: fix compilation with GCC < 4.4.6
ad9389b: fix compilation with GCC < 4.4.6
ths8200: fix compilation with GCC < 4.4.6

 drivers/media/i2c/ad9389b.c | 15 ++++++---------
 drivers/media/i2c/adv7511.c | 16 +++++++---------
 drivers/media/i2c/adv7842.c | 30 ++++++++++++------------------
 drivers/media/i2c/ths8200.c | 12 ++++--------
 4 files changed, 29 insertions(+), 44 deletions(-)
Signature · 1 line
1.8.4