That is a warning you get when trying to compile a CPP file with a C option. Codeblocks solved this problem by adding a right click to compiler options, and at that location it lists items to exclude. In the C Only box -std=c11 is said to be excluded.
So you should never see that warning.
Unless
You add that option in project build option settings AND the compiler setting option. In that case when the removal of c flags from cpp builds is done, it only removes one of the two times you added the flags
You add in compiler settings -std=c11
And you add in project settings -std=c11
and this code only removes one of them when building cpp file
In sdk\compilercommandgenerator.cpp line 380
[size=8pt][font=courier]
wxString cFlags = m_CFlags[target];
wxArrayString remFlags;
if (compExec == ceC)
remFlags = GetArrayFromString(compiler->GetCPPOnlyFlags(), wxT(" "));
else if (compExec == ceCPP)
remFlags = GetArrayFromString(compiler->GetCOnlyFlags(), wxT(" "));
if (!remFlags.IsEmpty())
{
wxArrayString aCflags = GetArrayFromString(cFlags, wxT(" "));
for (size_t i = 0; i < remFlags.GetCount(); ++i)
{
int index = aCflags.Index(remFlags[i]);
if (index != wxNOT_FOUND)
aCflags.RemoveAt(index);
}
cFlags = GetStringFromArray(aCflags, wxT(" "), false);
}
[/font][/size]
to fix this we need to remove all possible flags on the list, not just one of them
[size=8pt][font=courier]
wxString cFlags = m_CFlags[target];
wxArrayString remFlags;
if (compExec == ceC)
remFlags = GetArrayFromString(compiler->GetCPPOnlyFlags(), wxT(" "));
else if (compExec == ceCPP)
remFlags = GetArrayFromString(compiler->GetCOnlyFlags(), wxT(" "));
if (!remFlags.IsEmpty())
{
wxArrayString aCflags = GetArrayFromString(cFlags, wxT(" "));
for (size_t i = 0; i < remFlags.GetCount(); ++i)
{
//RE_CODE_CHANGE while loop used to remove multiple same flags in config script
int index = aCflags.Index(remFlags[i]);
while (index != wxNOT_FOUND)
{
aCflags.RemoveAt(index);
index = aCflags.Index(remFlags[i]);
}
//RE_CODE_CHANGE END
}
cFlags = GetStringFromArray(aCflags, wxT(" "), false);
}
[/font][/size]
If someone with SVN change rights wants to add that change it will fix the issue that made it where in some cases the option exclusion list was not excluding even when an option was listed there.
another method would be to check the command line for duplicates and delete them before doing that step of removing c cpp exclusive commands, if there are no reasons for duplicates and there are no reasons a user might want to know if he added same command option twice, this code could be added but it really is a design decision.
[size=8pt][font=courier]
// Special handling for compiler options to filter between C and C++ compilers
wxString cFlags = m_CFlags[target];
//RE_CODE_CHANGE remove duplicate flags
wxArrayString aCflagsRemoveDups = GetArrayFromString(cFlags, wxT(" "));
wxArrayString aCflagsNoDups;
aCflagsNoDups.Empty();
if(!aCflagsRemoveDups.IsEmpty())
{
for (size_t i = 0; i < aCflagsRemoveDups.GetCount(); ++i)
{
int index = aCflagsNoDups.Index(aCflagsRemoveDups[i]);
if(index == wxNOT_FOUND)
{
aCflagsNoDups.Add(aCflagsRemoveDups[i]);
}
}
cFlags = GetStringFromArray(aCflagsNoDups, wxT(" "), false);
}
aCflagsRemoveDups.Clear();
aCflagsNoDups.Clear();
//RE_CODE_CHANGE END remove duplicate flags
wxArrayString remFlags;
if (compExec == ceC)[/font][/size]
Either one of those fixes solves that problem that created some confusion where someone said they were seeing that warning, when they had the warning listed in exclusion box to be only used for c or cpp compiling.