Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
CC makes C::B hang in ExpandBackticks
oBFusCATed:
--- Quote from: MortenMacFly on January 05, 2013, 02:41:07 pm ---Which distro do you use (in case its Windows)?
--- End quote ---
Gentoo linux in this case, I've not booted windows for quite a long time...
ollydbg:
--- Quote from: MortenMacFly on January 05, 2013, 02:41:07 pm ---
--- Quote from: oBFusCATed on January 05, 2013, 02:25:24 pm ---I've just upgraded to llvm/clang 3.2 and linking .a files doesn't work anymore. With 3.1 all was fine...
--- End quote ---
Which distro do you use (in case its Windows)? I am looking for a working up-to-date distro of Clang for Windows 32.
I used to use this one:
http://www.ishani.org/web/articles/code/clang-win32/
...but it doesn't work anymore on WinXP/32.
--- End quote ---
OT
From mingw64 maillist:
--- Quote ---Hi,
A new LLVM/Clang has been released, with even better C++11 support. Sadly, no important Windows specific things were fixed or added since the previous release (that I know of), so you're still limited to GCC 4.6.3's libstdc++.
The previous 4.6.3 GCC linux64 build was also incompatible with older Linux installs, like Debian stable. This one is buillt on Debian stable, so should work on any non-ancient Linux install. If you need older or 32-bit linux, download the source package and build it yourself :)
Cheers,
Ruben
PS: Download links:
http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Personal%20Builds/rubenvb/release/
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/
--- End quote ---
I haven't tried it.
Alpha:
--- Quote from: oBFusCATed on January 05, 2013, 02:25:24 pm ---I've just upgraded to llvm/clang 3.2 and linking .a files doesn't work anymore. With 3.1 all was fine...
--- End quote ---
Oh; I was using 3.0 and 3.1 of Clang.
--- Quote from: oBFusCATed on January 05, 2013, 02:25:24 pm ---Also the problem is that you never check if the cmd[0]=="". As far as I can see your patch doesn't add such checks. Executing ""+" "+"-version" will never be a good idea...
--- End quote ---
cmd[0] only became an empty string because of the incorrect behavior in GetExecName() (which the patch fixes).
... but I guess I should add a check in case there is some other situation that has not been considered.
oBFusCATed:
--- Quote from: Alpha on January 05, 2013, 04:54:37 pm ---... but I guess I should add a check in case there is some other situation that has not been considered.
--- End quote ---
Yes, this part of the code should be more bulletproofed than the others :)
Alpha:
--- Quote from: oBFusCATed on January 05, 2013, 05:07:04 pm ---Yes, this part of the code should be more bulletproofed than the others :)
--- End quote ---
--- Code: ---Index: src/sdk/compiler.cpp
===================================================================
--- src/sdk/compiler.cpp (revision 8758)
+++ src/sdk/compiler.cpp (working copy)
@@ -1151,6 +1151,8 @@
else if (node->GetAttribute(wxT("exec"), &test))
{
wxArrayString cmd = GetArrayFromString(test, wxT(" "));
+ if (cmd.IsEmpty())
+ return false;
wxString path;
wxGetEnv(wxT("PATH"), &path);
const wxString origPath = path;
@@ -1171,20 +1173,21 @@
}
wxSetEnv(wxT("PATH"), path);
cmd[0] = GetExecName(cmd[0]);
- if (node->GetAttribute(wxT("regex"), &test))
+
+ long ret = -1;
+ if ( !cmd[0].IsEmpty() ) // should never be empty
{
- long ret;
- {
- wxLogNull logNo;
- ret = wxExecute(GetStringFromArray(cmd, wxT(" "), false), cmd);
- }
+ wxLogNull logNo; // do not warn if execution fails
+ ret = wxExecute(GetStringFromArray(cmd, wxT(" "), false), cmd);
+ }
+
+ if (ret != 0) // execution failed
+ val = (node->GetAttribute(wxT("default"), wxEmptyString) == wxT("true"));
+ else if (node->GetAttribute(wxT("regex"), &test))
+ {
wxRegEx re;
- if (ret != 0)
+ if (re.Compile(test))
{
- val = (node->GetAttribute(wxT("default"), wxEmptyString) == wxT("true"));
- }
- else if (re.Compile(test))
- {
for (size_t i = 0; i < cmd.GetCount(); ++i)
{
if (re.Matches(cmd[i]))
@@ -1195,20 +1198,17 @@
}
}
}
- else
- {
- wxLogNull logNo;
- long ret = wxExecute(GetStringFromArray(cmd, wxT(" "), false));
- val = (ret != 0);
- }
- wxSetEnv(wxT("PATH"), origPath);
+ else // execution succeeded (and no regex test given)
+ val = true;
+
+ wxSetEnv(wxT("PATH"), origPath); // restore path
}
return val;
}
wxString Compiler::GetExecName(const wxString& name)
{
- wxString ret;
+ wxString ret = name;
if (name == wxT("C"))
ret = m_Programs.C;
else if (name == wxT("CPP"))
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version