[#6547] bfin-linux-uclibc-gcc: error: ‘for’ loop initial declaration used outside C99 mode

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6547] bfin-linux-uclibc-gcc: error: ‘for’ loop initial declaration used outside C99 mode

Submitted By: Aaron Wu

Open Date

2011-04-15 05:42:56     Close Date

2013-07-02 05:40:14

Priority:

Medium     Assignee:

Nobody

Board:

N/A     Silicon Revision:

Resolution:

Rejected     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

Ubuntu 10.04

toolchain rev.:

    kernel rev.:

2.6.32

State:

Closed     Found In Release:

2010R1-RC4

Is this bug repeatable?:

yes     

Summary: bfin-linux-uclibc-gcc: error: ‘for’ loop initial declaration used outside C99 mode

Details:

 

Some of the open source application code like the VLC(http://www.videolan.org/) would have lines like:

for (int i =0; i< 100, i++)

 

when compiled by bfin-linux-uclibc-gcc it will generate error message: error: ‘for’ loop initial declaration used outside C99 mode

 

it's in C source code not C++. Any suggestions?

 

Follow-ups

 

--- Mike Frysinger                                           2011-04-15 05:46:46

you must specify the correct -std= flag when compiling.  per the gcc man page,

gnu89 is the default for C code.  so you'll probably want -std=gnu99.

 

--- Aaron Wu                                                 2011-04-15 06:35:00

thanks Mike, very helpful.

 

--- Mingquan Pan                                             2013-07-02 06:43:50

So close.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes