How to use C11 standard in Code::Blocks
Like the Title says I need to make code::blocks to work with C11 and I can't figure out how to do it.
I went to settings => compiler settings => Other options and I added -std=c11 and tried also with -std=gnu11, both doesn't seems to work.
I compiled gcc-5.2 and then I changed the default compiler (gcc-4.9) and still no result.
When I try to compile the following program:
#include<stdio.h>
int main(void){
int arr = {0,1,2,3,4};
for(int i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
I get the following:
|6|error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode|
But if I do it in terminal (ubuntu 15.04, 64BIT, gcc-5.2):
./install/gcc-5.2.0/bin/gcc5.2 program.c -o program
Seems to work fine.
My question is, how to make code::blocks to work with c11 ?
c codeblocks c11 gcc5.2
add a comment |
Like the Title says I need to make code::blocks to work with C11 and I can't figure out how to do it.
I went to settings => compiler settings => Other options and I added -std=c11 and tried also with -std=gnu11, both doesn't seems to work.
I compiled gcc-5.2 and then I changed the default compiler (gcc-4.9) and still no result.
When I try to compile the following program:
#include<stdio.h>
int main(void){
int arr = {0,1,2,3,4};
for(int i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
I get the following:
|6|error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode|
But if I do it in terminal (ubuntu 15.04, 64BIT, gcc-5.2):
./install/gcc-5.2.0/bin/gcc5.2 program.c -o program
Seems to work fine.
My question is, how to make code::blocks to work with c11 ?
c codeblocks c11 gcc5.2
Since the GCC 5.x versions run with-std=gnu11by default, Code::Blocks must be doing something (such as passing-ansior-std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)
– Jonathan Leffler
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansipkg-config --cflags gtk+-3.0
– Michi
Dec 8 '15 at 18:33
The-ansiis doing the damage; it is equivalent to-std=c90or perhaps-std=gnu90— it explicitly undoes-std=c11or-std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle:-Wall … `pkg-config --cflags gtk+-3.0`— like that.
– Jonathan Leffler
Dec 8 '15 at 18:34
@JonathanLeffler Thank you, you right,-ansiwas the problem. I though that i need that option too, I mean-ansi
– Michi
Dec 8 '15 at 18:36
add a comment |
Like the Title says I need to make code::blocks to work with C11 and I can't figure out how to do it.
I went to settings => compiler settings => Other options and I added -std=c11 and tried also with -std=gnu11, both doesn't seems to work.
I compiled gcc-5.2 and then I changed the default compiler (gcc-4.9) and still no result.
When I try to compile the following program:
#include<stdio.h>
int main(void){
int arr = {0,1,2,3,4};
for(int i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
I get the following:
|6|error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode|
But if I do it in terminal (ubuntu 15.04, 64BIT, gcc-5.2):
./install/gcc-5.2.0/bin/gcc5.2 program.c -o program
Seems to work fine.
My question is, how to make code::blocks to work with c11 ?
c codeblocks c11 gcc5.2
Like the Title says I need to make code::blocks to work with C11 and I can't figure out how to do it.
I went to settings => compiler settings => Other options and I added -std=c11 and tried also with -std=gnu11, both doesn't seems to work.
I compiled gcc-5.2 and then I changed the default compiler (gcc-4.9) and still no result.
When I try to compile the following program:
#include<stdio.h>
int main(void){
int arr = {0,1,2,3,4};
for(int i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
I get the following:
|6|error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode|
But if I do it in terminal (ubuntu 15.04, 64BIT, gcc-5.2):
./install/gcc-5.2.0/bin/gcc5.2 program.c -o program
Seems to work fine.
My question is, how to make code::blocks to work with c11 ?
c codeblocks c11 gcc5.2
c codeblocks c11 gcc5.2
edited Dec 11 '15 at 9:49
Lundin
109k17160265
109k17160265
asked Dec 8 '15 at 18:27
MichiMichi
3,10731937
3,10731937
Since the GCC 5.x versions run with-std=gnu11by default, Code::Blocks must be doing something (such as passing-ansior-std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)
– Jonathan Leffler
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansipkg-config --cflags gtk+-3.0
– Michi
Dec 8 '15 at 18:33
The-ansiis doing the damage; it is equivalent to-std=c90or perhaps-std=gnu90— it explicitly undoes-std=c11or-std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle:-Wall … `pkg-config --cflags gtk+-3.0`— like that.
– Jonathan Leffler
Dec 8 '15 at 18:34
@JonathanLeffler Thank you, you right,-ansiwas the problem. I though that i need that option too, I mean-ansi
– Michi
Dec 8 '15 at 18:36
add a comment |
Since the GCC 5.x versions run with-std=gnu11by default, Code::Blocks must be doing something (such as passing-ansior-std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)
– Jonathan Leffler
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansipkg-config --cflags gtk+-3.0
– Michi
Dec 8 '15 at 18:33
The-ansiis doing the damage; it is equivalent to-std=c90or perhaps-std=gnu90— it explicitly undoes-std=c11or-std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle:-Wall … `pkg-config --cflags gtk+-3.0`— like that.
– Jonathan Leffler
Dec 8 '15 at 18:34
@JonathanLeffler Thank you, you right,-ansiwas the problem. I though that i need that option too, I mean-ansi
– Michi
Dec 8 '15 at 18:36
Since the GCC 5.x versions run with
-std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)– Jonathan Leffler
Dec 8 '15 at 18:33
Since the GCC 5.x versions run with
-std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)– Jonathan Leffler
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansi pkg-config --cflags gtk+-3.0– Michi
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansi pkg-config --cflags gtk+-3.0– Michi
Dec 8 '15 at 18:33
The
-ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle: -Wall … `pkg-config --cflags gtk+-3.0` — like that.– Jonathan Leffler
Dec 8 '15 at 18:34
The
-ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle: -Wall … `pkg-config --cflags gtk+-3.0` — like that.– Jonathan Leffler
Dec 8 '15 at 18:34
@JonathanLeffler Thank you, you right,
-ansi was the problem. I though that i need that option too, I mean -ansi– Michi
Dec 8 '15 at 18:36
@JonathanLeffler Thank you, you right,
-ansi was the problem. I though that i need that option too, I mean -ansi– Michi
Dec 8 '15 at 18:36
add a comment |
7 Answers
7
active
oldest
votes
Since the GCC 5.x versions run with -std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently.
Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it.
Options that are used are:
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11
-O0 -g -ansi `pkg-config --cflags gtk+-3.0`
The -ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11.
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the-O0is not one I'd normally use. I routinely use-O3 -g. I add some:-Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the-ansi, what you've got is workable though possibly a bit sub-optimal (because-O0means minimal optimization).
– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use-O0is because of this =>> Please take a look
– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with-O0so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using-O0very often just because of that. Thanks for the x-ref.
– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
|
show 2 more comments
Am just a learner (beginner - very new) but I hope this might help (though the thread is old).
(code visible in the image is example 12.2 -- forc99.c from Stephen Prata C Primer Plus)

I created new flag
Settings -> Compiler -> (under general)Right click on general -> New Flag -> Enter details from image -> Ok
After that check the box of the new flag just created. (worked for me)
[If you look in the image there is option for -std=c99 (just above the one I created), You can use that option for c99 support.]
(By the way the gcc version for code::blocks 16.01 mingw 32bit, I use this, is 4.9.2)
add a comment |
Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
- Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).
- Install it. It will end up in some obscure folder like
C:Program Filesmingw-w64x86_64-4.9.1-win32-seh-rt_v3-rev1mingw64. - Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory. Click the "auto detect" button.
- In the same tab, check that the C compiler is
x86_64-w64-mingw32-gcc.exe(since you now might have multiple installations of GCC on your computer) and that the make program ismingw32-make.exe. - In the tab Compiler settings, right click on the list of compiler flags and select "New flag". For "name" type in C11, for compiler flags type in
-std=c11. Click ok and check the new C11 option you just created. - Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C..." (-pedantic-errors). Check the option "Enable all common compiler warnings" (-Wall).
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I useubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.
– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -gare my compiler options, but I had used-ansiand didn't know that conflicts with-std=c11.
– Michi
Dec 11 '15 at 15:26
add a comment |
Go to Settings-> compiler-> Compiler Flags-> General-> tick the box next to " Have g++ follow the c++11 ISO"
DONE!!!
add a comment |
I also faced the same problem in my CodeBlock Project.
I am using version CodeBlock Version:17.12.
I fixed with following steps:
- Go to Setting -> Copmpiler Tab.
- "Global Compiler Settings:" pop is openend.
- Check Selected Compiler : " GNU GCC Compiler"
- Select "Compiler Flag" Tab.
- Select following check boxes:
- Have g++ follow the C++11 ISO C++ language standard
- Have gcc follow the 2011 ISO C language standard
- Save the settings.
- Now i am able to Complie C++11 code.
Hope it works for you guys as well.
add a comment |
The reason is because you are declaring i in for loop.
Try separating it like below:
#include<stdio.h>
int main(void)
{
int arr = {0,1,2,3,4};
int i;
for(i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
It will work. Happy coding:)
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
add a comment |
go to "setting" -> "compiler", then see the option follow "c++11 ISO inc compiler" setting tab.

OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34163283%2fhow-to-use-c11-standard-in-codeblocks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since the GCC 5.x versions run with -std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently.
Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it.
Options that are used are:
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11
-O0 -g -ansi `pkg-config --cflags gtk+-3.0`
The -ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11.
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the-O0is not one I'd normally use. I routinely use-O3 -g. I add some:-Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the-ansi, what you've got is workable though possibly a bit sub-optimal (because-O0means minimal optimization).
– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use-O0is because of this =>> Please take a look
– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with-O0so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using-O0very often just because of that. Thanks for the x-ref.
– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
|
show 2 more comments
Since the GCC 5.x versions run with -std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently.
Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it.
Options that are used are:
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11
-O0 -g -ansi `pkg-config --cflags gtk+-3.0`
The -ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11.
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the-O0is not one I'd normally use. I routinely use-O3 -g. I add some:-Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the-ansi, what you've got is workable though possibly a bit sub-optimal (because-O0means minimal optimization).
– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use-O0is because of this =>> Please take a look
– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with-O0so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using-O0very often just because of that. Thanks for the x-ref.
– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
|
show 2 more comments
Since the GCC 5.x versions run with -std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently.
Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it.
Options that are used are:
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11
-O0 -g -ansi `pkg-config --cflags gtk+-3.0`
The -ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11.
Since the GCC 5.x versions run with -std=gnu11 by default, Code::Blocks must be doing something (such as passing -ansi or -std=gnu90) to the compiler to make it work differently.
Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it.
Options that are used are:
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11
-O0 -g -ansi `pkg-config --cflags gtk+-3.0`
The -ansi is doing the damage; it is equivalent to -std=c90 or perhaps -std=gnu90 — it explicitly undoes -std=c11 or -std=gnu11.
answered Dec 8 '15 at 18:40
Jonathan LefflerJonathan Leffler
566k916781029
566k916781029
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the-O0is not one I'd normally use. I routinely use-O3 -g. I add some:-Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the-ansi, what you've got is workable though possibly a bit sub-optimal (because-O0means minimal optimization).
– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use-O0is because of this =>> Please take a look
– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with-O0so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using-O0very often just because of that. Thanks for the x-ref.
– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
|
show 2 more comments
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the-O0is not one I'd normally use. I routinely use-O3 -g. I add some:-Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the-ansi, what you've got is workable though possibly a bit sub-optimal (because-O0means minimal optimization).
– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use-O0is because of this =>> Please take a look
– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with-O0so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using-O0very often just because of that. Thanks for the x-ref.
– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
I didn't know, I hope the other Flags are OK.
– Michi
Dec 8 '15 at 18:41
Yes, though the
-O0 is not one I'd normally use. I routinely use -O3 -g. I add some: -Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the -ansi, what you've got is workable though possibly a bit sub-optimal (because -O0 means minimal optimization).– Jonathan Leffler
Dec 8 '15 at 18:44
Yes, though the
-O0 is not one I'd normally use. I routinely use -O3 -g. I add some: -Wmissing-prototypes -Wold-style-definition, and sometimes add others. Once you lose the -ansi, what you've got is workable though possibly a bit sub-optimal (because -O0 means minimal optimization).– Jonathan Leffler
Dec 8 '15 at 18:44
The main reason why I use
-O0 is because of this =>> Please take a look– Michi
Dec 8 '15 at 18:47
The main reason why I use
-O0 is because of this =>> Please take a look– Michi
Dec 8 '15 at 18:47
Hmm…interesting. Compile with
-O0 so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using -O0 very often just because of that. Thanks for the x-ref.– Jonathan Leffler
Dec 8 '15 at 18:55
Hmm…interesting. Compile with
-O0 so that even if your program is so simple that GCC can optimize away your memory leaks, they still get spotted because they aren't optimized away. If the memory doesn't leak because the compiler spots that it doesn't need to allocate the memory, is it still a leak? (And does a tree falling in the forest make a sound when there's no-one there to hear it?) It's interesting how sophisticated the optimizer is. I'm not sure I'd go about using -O0 very often just because of that. Thanks for the x-ref.– Jonathan Leffler
Dec 8 '15 at 18:55
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
I don't think this will work with the default installation of Codeblocks, because it uses an older version of GCC. I installed Codeblocks half a year ago and then I had to manually tell it to use a different GCC. Since this was for Windows, I had to point out the MinGW 64 installation.
– Lundin
Dec 11 '15 at 9:33
|
show 2 more comments
Am just a learner (beginner - very new) but I hope this might help (though the thread is old).
(code visible in the image is example 12.2 -- forc99.c from Stephen Prata C Primer Plus)

I created new flag
Settings -> Compiler -> (under general)Right click on general -> New Flag -> Enter details from image -> Ok
After that check the box of the new flag just created. (worked for me)
[If you look in the image there is option for -std=c99 (just above the one I created), You can use that option for c99 support.]
(By the way the gcc version for code::blocks 16.01 mingw 32bit, I use this, is 4.9.2)
add a comment |
Am just a learner (beginner - very new) but I hope this might help (though the thread is old).
(code visible in the image is example 12.2 -- forc99.c from Stephen Prata C Primer Plus)

I created new flag
Settings -> Compiler -> (under general)Right click on general -> New Flag -> Enter details from image -> Ok
After that check the box of the new flag just created. (worked for me)
[If you look in the image there is option for -std=c99 (just above the one I created), You can use that option for c99 support.]
(By the way the gcc version for code::blocks 16.01 mingw 32bit, I use this, is 4.9.2)
add a comment |
Am just a learner (beginner - very new) but I hope this might help (though the thread is old).
(code visible in the image is example 12.2 -- forc99.c from Stephen Prata C Primer Plus)

I created new flag
Settings -> Compiler -> (under general)Right click on general -> New Flag -> Enter details from image -> Ok
After that check the box of the new flag just created. (worked for me)
[If you look in the image there is option for -std=c99 (just above the one I created), You can use that option for c99 support.]
(By the way the gcc version for code::blocks 16.01 mingw 32bit, I use this, is 4.9.2)
Am just a learner (beginner - very new) but I hope this might help (though the thread is old).
(code visible in the image is example 12.2 -- forc99.c from Stephen Prata C Primer Plus)

I created new flag
Settings -> Compiler -> (under general)Right click on general -> New Flag -> Enter details from image -> Ok
After that check the box of the new flag just created. (worked for me)
[If you look in the image there is option for -std=c99 (just above the one I created), You can use that option for c99 support.]
(By the way the gcc version for code::blocks 16.01 mingw 32bit, I use this, is 4.9.2)
edited Apr 26 '17 at 5:19
McGrady
6,018102237
6,018102237
answered Dec 15 '16 at 8:10
spaceoutspaceout
606
606
add a comment |
add a comment |
Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
- Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).
- Install it. It will end up in some obscure folder like
C:Program Filesmingw-w64x86_64-4.9.1-win32-seh-rt_v3-rev1mingw64. - Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory. Click the "auto detect" button.
- In the same tab, check that the C compiler is
x86_64-w64-mingw32-gcc.exe(since you now might have multiple installations of GCC on your computer) and that the make program ismingw32-make.exe. - In the tab Compiler settings, right click on the list of compiler flags and select "New flag". For "name" type in C11, for compiler flags type in
-std=c11. Click ok and check the new C11 option you just created. - Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C..." (-pedantic-errors). Check the option "Enable all common compiler warnings" (-Wall).
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I useubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.
– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -gare my compiler options, but I had used-ansiand didn't know that conflicts with-std=c11.
– Michi
Dec 11 '15 at 15:26
add a comment |
Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
- Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).
- Install it. It will end up in some obscure folder like
C:Program Filesmingw-w64x86_64-4.9.1-win32-seh-rt_v3-rev1mingw64. - Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory. Click the "auto detect" button.
- In the same tab, check that the C compiler is
x86_64-w64-mingw32-gcc.exe(since you now might have multiple installations of GCC on your computer) and that the make program ismingw32-make.exe. - In the tab Compiler settings, right click on the list of compiler flags and select "New flag". For "name" type in C11, for compiler flags type in
-std=c11. Click ok and check the new C11 option you just created. - Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C..." (-pedantic-errors). Check the option "Enable all common compiler warnings" (-Wall).
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I useubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.
– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -gare my compiler options, but I had used-ansiand didn't know that conflicts with-std=c11.
– Michi
Dec 11 '15 at 15:26
add a comment |
Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
- Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).
- Install it. It will end up in some obscure folder like
C:Program Filesmingw-w64x86_64-4.9.1-win32-seh-rt_v3-rev1mingw64. - Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory. Click the "auto detect" button.
- In the same tab, check that the C compiler is
x86_64-w64-mingw32-gcc.exe(since you now might have multiple installations of GCC on your computer) and that the make program ismingw32-make.exe. - In the tab Compiler settings, right click on the list of compiler flags and select "New flag". For "name" type in C11, for compiler flags type in
-std=c11. Click ok and check the new C11 option you just created. - Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C..." (-pedantic-errors). Check the option "Enable all common compiler warnings" (-Wall).
Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
- Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).
- Install it. It will end up in some obscure folder like
C:Program Filesmingw-w64x86_64-4.9.1-win32-seh-rt_v3-rev1mingw64. - Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory. Click the "auto detect" button.
- In the same tab, check that the C compiler is
x86_64-w64-mingw32-gcc.exe(since you now might have multiple installations of GCC on your computer) and that the make program ismingw32-make.exe. - In the tab Compiler settings, right click on the list of compiler flags and select "New flag". For "name" type in C11, for compiler flags type in
-std=c11. Click ok and check the new C11 option you just created. - Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C..." (-pedantic-errors). Check the option "Enable all common compiler warnings" (-Wall).
answered Dec 11 '15 at 9:47
LundinLundin
109k17160265
109k17160265
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I useubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.
– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -gare my compiler options, but I had used-ansiand didn't know that conflicts with-std=c11.
– Michi
Dec 11 '15 at 15:26
add a comment |
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I useubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.
– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -gare my compiler options, but I had used-ansiand didn't know that conflicts with-std=c11.
– Michi
Dec 11 '15 at 15:26
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I use
ubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.– Michi
Dec 11 '15 at 13:39
Thank you for your Answer, it will be good for someone who work with Microsoft (windows) products, but me I'm a Linux user since 2004. I did explain in my Question that I use
ubuntu 15.04, 64BIT, gcc-5.2. Any way +1 for your Answer.– Michi
Dec 11 '15 at 13:39
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
@Michi The way of configuring Codeblocks to pick a different compiler & set it to compile according to C11 should be the same in Ubuntu though. Far easier probably, since you don't have to go through the Mingw installation fuss. Anyway, you seem to be adding compiler options in the wrong way, this answer explains how you should set Codeblocks to compile for C11.
– Lundin
Dec 11 '15 at 14:35
This
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -g are my compiler options, but I had used -ansi and didn't know that conflicts with -std=c11.– Michi
Dec 11 '15 at 15:26
This
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -Wmissing-prototypes -Wold-style-definition -std=c11 -O0 -g are my compiler options, but I had used -ansi and didn't know that conflicts with -std=c11.– Michi
Dec 11 '15 at 15:26
add a comment |
Go to Settings-> compiler-> Compiler Flags-> General-> tick the box next to " Have g++ follow the c++11 ISO"
DONE!!!
add a comment |
Go to Settings-> compiler-> Compiler Flags-> General-> tick the box next to " Have g++ follow the c++11 ISO"
DONE!!!
add a comment |
Go to Settings-> compiler-> Compiler Flags-> General-> tick the box next to " Have g++ follow the c++11 ISO"
DONE!!!
Go to Settings-> compiler-> Compiler Flags-> General-> tick the box next to " Have g++ follow the c++11 ISO"
DONE!!!
answered Sep 27 '17 at 4:54
Jyoti YadavJyoti Yadav
10215
10215
add a comment |
add a comment |
I also faced the same problem in my CodeBlock Project.
I am using version CodeBlock Version:17.12.
I fixed with following steps:
- Go to Setting -> Copmpiler Tab.
- "Global Compiler Settings:" pop is openend.
- Check Selected Compiler : " GNU GCC Compiler"
- Select "Compiler Flag" Tab.
- Select following check boxes:
- Have g++ follow the C++11 ISO C++ language standard
- Have gcc follow the 2011 ISO C language standard
- Save the settings.
- Now i am able to Complie C++11 code.
Hope it works for you guys as well.
add a comment |
I also faced the same problem in my CodeBlock Project.
I am using version CodeBlock Version:17.12.
I fixed with following steps:
- Go to Setting -> Copmpiler Tab.
- "Global Compiler Settings:" pop is openend.
- Check Selected Compiler : " GNU GCC Compiler"
- Select "Compiler Flag" Tab.
- Select following check boxes:
- Have g++ follow the C++11 ISO C++ language standard
- Have gcc follow the 2011 ISO C language standard
- Save the settings.
- Now i am able to Complie C++11 code.
Hope it works for you guys as well.
add a comment |
I also faced the same problem in my CodeBlock Project.
I am using version CodeBlock Version:17.12.
I fixed with following steps:
- Go to Setting -> Copmpiler Tab.
- "Global Compiler Settings:" pop is openend.
- Check Selected Compiler : " GNU GCC Compiler"
- Select "Compiler Flag" Tab.
- Select following check boxes:
- Have g++ follow the C++11 ISO C++ language standard
- Have gcc follow the 2011 ISO C language standard
- Save the settings.
- Now i am able to Complie C++11 code.
Hope it works for you guys as well.
I also faced the same problem in my CodeBlock Project.
I am using version CodeBlock Version:17.12.
I fixed with following steps:
- Go to Setting -> Copmpiler Tab.
- "Global Compiler Settings:" pop is openend.
- Check Selected Compiler : " GNU GCC Compiler"
- Select "Compiler Flag" Tab.
- Select following check boxes:
- Have g++ follow the C++11 ISO C++ language standard
- Have gcc follow the 2011 ISO C language standard
- Save the settings.
- Now i am able to Complie C++11 code.
Hope it works for you guys as well.
edited Jan 20 at 12:54
Paul T.
1,51571319
1,51571319
answered Jan 20 at 3:08
Chandan kumarChandan kumar
11
11
add a comment |
add a comment |
The reason is because you are declaring i in for loop.
Try separating it like below:
#include<stdio.h>
int main(void)
{
int arr = {0,1,2,3,4};
int i;
for(i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
It will work. Happy coding:)
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
add a comment |
The reason is because you are declaring i in for loop.
Try separating it like below:
#include<stdio.h>
int main(void)
{
int arr = {0,1,2,3,4};
int i;
for(i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
It will work. Happy coding:)
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
add a comment |
The reason is because you are declaring i in for loop.
Try separating it like below:
#include<stdio.h>
int main(void)
{
int arr = {0,1,2,3,4};
int i;
for(i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
It will work. Happy coding:)
The reason is because you are declaring i in for loop.
Try separating it like below:
#include<stdio.h>
int main(void)
{
int arr = {0,1,2,3,4};
int i;
for(i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
It will work. Happy coding:)
answered Aug 11 '16 at 12:59
Ayesha GuptaAyesha Gupta
82
82
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
add a comment |
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
I upvoted you because today I made the same mistake like you now, watching a Code without reading the whole Question. Please read the Question again and do a good answer about it. :)
– Michi
Aug 11 '16 at 15:27
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
There is nothing wrong with the code, the question is about C11. Do you even know what C11, or even C99 is? This doesn't answer the question - it is not even related to the question.
– Lundin
Aug 12 '16 at 7:44
add a comment |
go to "setting" -> "compiler", then see the option follow "c++11 ISO inc compiler" setting tab.

OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
add a comment |
go to "setting" -> "compiler", then see the option follow "c++11 ISO inc compiler" setting tab.

OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
add a comment |
go to "setting" -> "compiler", then see the option follow "c++11 ISO inc compiler" setting tab.

go to "setting" -> "compiler", then see the option follow "c++11 ISO inc compiler" setting tab.

edited Nov 25 '16 at 11:36
ddb
2,19671930
2,19671930
answered Nov 25 '16 at 9:11
Ravi GuruRavi Guru
372
372
OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
add a comment |
OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
OP was asking for C11
– Antti Haapala
Nov 6 '17 at 4:25
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34163283%2fhow-to-use-c11-standard-in-codeblocks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Since the GCC 5.x versions run with
-std=gnu11by default, Code::Blocks must be doing something (such as passing-ansior-std=gnu90) to the compiler to make it work differently. Investigate all the options that are sent to the compiler. Find a way to have Code::Blocks show you the exact incantation it uses when compiling. Then work out how to fix it. (I've not used Code::Blocks so I can't be more helpful than that — assuming this is of any help at all.)– Jonathan Leffler
Dec 8 '15 at 18:33
@JonathanLeffler This are the Options that is use =>>
-Wall -Wextra -Werror -Wstrict-prototypes -Wconversion -std=gnu11 -O0 -g -ansipkg-config --cflags gtk+-3.0– Michi
Dec 8 '15 at 18:33
The
-ansiis doing the damage; it is equivalent to-std=c90or perhaps-std=gnu90— it explicitly undoes-std=c11or-std=gnu11. (And, FYI, you can embed back-quotes in the code block of a comment by using two to start and end and one in the middle:-Wall … `pkg-config --cflags gtk+-3.0`— like that.– Jonathan Leffler
Dec 8 '15 at 18:34
@JonathanLeffler Thank you, you right,
-ansiwas the problem. I though that i need that option too, I mean-ansi– Michi
Dec 8 '15 at 18:36