#66722 closed defect (fixed)

avrdude fails to build with gcc-4.2: error: ‘for’ loop initial declaration used outside C99 mode; error: ‘struct Data’ has no member named ‘ll’

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: powerpc, leopard, snowleopard, rosetta Cc:
Port: avrdude

Description

Making all in .
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_avrdude/avrdude/work/avrdude-7.0'
  CC       avrdude-main.o
  CC       avrdude-whereami.o
  CC       libavrdude_a-config_gram.o
  CC       libavrdude_a-lexer.o
  CC       avrdude-term.o
  CC       libavrdude_a-avr.o
  CC       libavrdude_a-avr910.o
  CC       libavrdude_a-arduino.o
main.c: In function ‘replace_backslashes’:
main.c:305: error: ‘for’ loop initial declaration used outside C99 mode
term.c: In function ‘chardump_line’:
term.c:190: error: redeclaration of ‘i’ with no linkage
term.c:187: error: previous declaration of ‘i’ was here
term.c:190: error: ‘for’ loop initial declaration used outside C99 mode
term.c: In function ‘cmd_dump’:
term.c:312: error: ‘for’ loop initial declaration used outside C99 mode
term.c: In function ‘cmd_write’:
term.c:420: error: unknown field ‘ll’ specified in initializer
term.c:421: warning: missing braces around initializer
term.c:421: warning: (near initialization for ‘data.<anonymous>’)
term.c:522: error: ‘for’ loop initial declaration used outside C99 mode
make[2]: *** [avrdude-main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [avrdude-term.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_avrdude/avrdude/work/avrdude-7.0'
make[1]: *** [all-recursive] Error 1

Change History (4)

comment:1 Changed 22 months ago by barracuda156

This time just passing -std=c99 fails to help:

term.c: In function ‘cmd_write’:
term.c:413: warning: declaration does not declare anything
term.c:420: error: unknown field ‘ll’ specified in initializer
term.c:421: warning: excess elements in struct initializer
term.c:421: warning: (near initialization for ‘data’)
term.c:459: error: ‘struct Data’ has no member named ‘ll’
term.c:462: error: ‘struct Data’ has no member named ‘f’
term.c:468: error: ‘struct Data’ has no member named ‘ll’
term.c:499: error: ‘struct Data’ has no member named ‘ll’
term.c:504: error: ‘struct Data’ has no member named ‘ll’
term.c:505: error: ‘struct Data’ has no member named ‘ll’
term.c:505: error: ‘struct Data’ has no member named ‘ll’
term.c:509: error: ‘struct Data’ has no member named ‘ll’
term.c:511: error: ‘struct Data’ has no member named ‘ll’
term.c:513: error: ‘struct Data’ has no member named ‘ll’
term.c:515: error: ‘struct Data’ has no member named ‘ll’
term.c:525: error: ‘struct Data’ has no member named ‘a’
term.c:526: error: ‘struct Data’ has no member named ‘ll’
term.c:527: error: ‘struct Data’ has no member named ‘a’
term.c:528: error: ‘struct Data’ has no member named ‘ll’
term.c:529: error: ‘struct Data’ has no member named ‘a’
term.c:530: error: ‘struct Data’ has no member named ‘a’
term.c:532: error: ‘struct Data’ has no member named ‘ll’
term.c:533: error: ‘struct Data’ has no member named ‘a’
term.c:534: error: ‘struct Data’ has no member named ‘a’
term.c:535: error: ‘struct Data’ has no member named ‘a’
term.c:536: error: ‘struct Data’ has no member named ‘a’
make[2]: *** [avrdude-term.o] Error 1

comment:2 Changed 22 months ago by barracuda156

Summary: avrdude fails to build with gcc-4.2: error: ‘for’ loop initial declaration used outside C99 modeavrdude fails to build with gcc-4.2: error: ‘for’ loop initial declaration used outside C99 mode; error: ‘struct Data’ has no member named ‘ll’

comment:3 in reply to:  1 Changed 22 months ago by jmroot (Joshua Root)

Replying to barracuda156:

This time just passing -std=c99 fails to help:

That's because the code is using an anonymous union member in a struct, which is a C11 feature.

comment:4 Changed 22 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In b04de4b38c16e7f05c006eb0aab460512c66bca6/macports-ports (master):

avrdude: fix build on <11
Fixes: #66722

Note: See TracTickets for help on using tickets.