using GCC to compile the code is to report
error: ‘for’ loop initial declarations are only allowed in C99 mode
note: use option -std=c99 or -std=gnu99 to compile your code
The
error is due to the increment being initialized in GCC directly in the for loop:
- for (int I = 0; I< len; I++) { li>
- } li> ol>
this syntax is incorrect in GCC, you must first define the I variable:
- int I; li>
- for (I = 0; i< len; I++) { li>
- li>
- } li> ol>
this is because GCC is based on the c89 standard, instead of the C99 standard, you can define the I variable within the for loop:
gcc src.c -std=c99 -o src
Read More:
- error: ‘for‘ loop initial declarations are only allowed in C99 mode
- How to Fix error: ‘for’ loop initial declarations are only allowed in C99 mode
- [Solved] Dev-C++ [Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode
- How to handle when select single is not allowed in loop
- Docker encountered a problem 4: yaml: Line 1: mapping values are not allowed in this context
- warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
- 【.Net Core】using declarations‘ is not available in C# 7.3. Please use language version 8.0 or greate
- Solve the problem of the C compiler identification is unknown or the cxx compiler identification is unknown in the process of using cmake
- You are not allowed to upload merges in Git push
- Fatal error C1853 error occurs when there are mixed .c files in the VS project
- Package pdftex.def Error: PDF mode expected, but DVI mode detected!_ mdpi_ Templatex compilation error in winedt
- Annotations are not allowed here
- Git push you are not allowed to upload merges
- yaml.scanner.ScannerError: mapping values are not allowed here
- Solve the problem of USB mouse failure in the laptop mode of Ubuntu
- Migration admin.0001_initial is applied before its dependency xxx.0001_initial on database ‘default‘
- Solve the problem of available for offline mode in Android studio compilation
- GitLab You are not allowed to push code to this project
- ValueError: Integers to negative integer powers are not allowed.
- Stm32f103c8t6 in keil compiler error: # 67: expected a “}” solution