ide/project; compiler: Fixed IDE hangs on numerous syntax errors
authorJerome St-Louis <jerome@ecere.com>
Thu, 12 Jun 2014 02:40:18 +0000 (22:40 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 12 Jun 2014 02:40:18 +0000 (22:40 -0400)
- Added GetLinePeek() to DualPipe class
- Modified ProcessBuildPipeOutput() to make use of GetLinePeek()
- Calling fflush() on stdout from compiler
- Did not apply to other IDE/Project locations where GetLine() is used with pipes
 (ProcessCleanPipeOutput(), Build() when eC_Debug is on, ProcessPipeOutputRaw() when justPrint or isVC is on)

compiler/bootstrap/ecere/bootstrap/DualPipe.c
compiler/bootstrap/libec/bootstrap/ecdefs.c
compiler/libec/src/ecdefs.ec
ecere/src/sys/DualPipe.ec
ide/src/project/Project.ec

index d8ce822..8f9af02 100644 (file)
@@ -496,6 +496,30 @@ __attribute__((unused)) struct __ecereNameSpace__ecere__sys__DualPipe * __ecereP
 DualPipe_Wait(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
 }
 
+int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof;
+
+unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetLinePeek(struct __ecereNameSpace__ecere__com__Instance * this, char * s, int max, int * charsRead)
+{
+__attribute__((unused)) struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
+char ch = (char)0;
+int c = 0;
+
+while(c < max - 1 && __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek(this) && ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, char *  ch))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = this;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Getc])(this, &ch) && ch != '\n')
+if(ch != '\r')
+s[c++] = ch;
+s[c] = '\0';
+*charsRead = c;
+return ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = this;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(this) || ch == '\n';
+}
+
 extern int vsnprintf(char * , size_t, const char * , __builtin_va_list);
 
 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, const char *  commandLine);
@@ -636,6 +660,7 @@ __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetSize", 0, __ecereMetho
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseInput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseInput, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseOutput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseOutput, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetExitCode", "int GetExitCode()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode, 1);
+__ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetLinePeek", "bool GetLinePeek(char * s, int max, int * charsRead)", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetLinePeek, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetProcessID", "int GetProcessID()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetProcessID, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Peek", "bool Peek()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Terminate", "void Terminate()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Terminate, 1);
index 8625960..90b4c27 100644 (file)
@@ -1885,6 +1885,7 @@ vsnprintf(string, sizeof (string), format, args);
 string[sizeof (string) - 1] = (char)0;
 __builtin_va_end(args);
 fputs(string, (bsl_stdout()));
+fflush((bsl_stdout()));
 ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application + structSize_Module)))->exitCode = 1;
 }
 else
@@ -1935,6 +1936,7 @@ vsnprintf(string, sizeof (string), format, args);
 string[sizeof (string) - 1] = (char)0;
 __builtin_va_end(args);
 fputs(string, (bsl_stdout()));
+fflush((bsl_stdout()));
 numWarnings++;
 }
 }
index 2041214..27dc50a 100644 (file)
@@ -1470,6 +1470,7 @@ void Compiler_Error(const char * format, ...)
          string[sizeof(string)-1] = 0;
          va_end(args);
          fputs(string, stdout);
+         fflush(stdout);
          __thisModule.application.exitCode = 1;
       }
       else
@@ -1517,6 +1518,7 @@ void Compiler_Warning(const char * format, ...)
       string[sizeof(string)-1] = 0;
       va_end(args);
       fputs(string, stdout);
+      fflush(stdout);
       numWarnings++;
    }
 }
index fd7104f..f9b965c 100644 (file)
@@ -52,6 +52,19 @@ public:
    int GetExitCode() { return DualPipe_GetExitCode(dp); }
    int GetProcessID() { return DualPipe_GetProcessID(dp); }
    void Wait() { DualPipe_Wait(dp); }
+
+   // Return true on getting EOF or new line
+   bool GetLinePeek(char * s, int max, int * charsRead)
+   {
+      char ch = 0;
+      int c = 0;
+      while(c < max-1 && Peek() && Getc(&ch) && ch != '\n')
+         if(ch != '\r')
+            s[c++] = ch;
+      s[c] = '\0';
+      *charsRead = c;
+      return Eof() || ch == '\n';
+   }
 };
 
 public DualPipe DualPipeOpenf(PipeOpenMode mode, const char * command, ...)
index 3bd9281..bd72046 100644 (file)
@@ -1477,6 +1477,7 @@ private:
       CompilerConfig compiler, ProjectConfig config, int bitDepth)
    {
       char line[65536];
+      int linePos = 0;
       bool compiling = false, linking = false, precompiling = false;
       int compilingEC = 0;
       int numErrors = 0, numWarnings = 0;
@@ -1539,356 +1540,342 @@ private:
 
       while(!f.Eof() && !ide.projectView.stopBuild)
       {
-         bool result = true;
          double lastTime = GetTime();
          bool wait = true;
-         while(result)
+         while(!f.Eof() && !ide.projectView.stopBuild)
          {
-            //printf("Peeking and GetLine...\n");
-            if((result = f.Peek()) && (result = f.GetLine(line, sizeof(line)-1)) && line[0])
+            int nChars;
+            bool lineDone = f.GetLinePeek(line + linePos, sizeof(line)-linePos-1, &nChars);
+            if(!lineDone) linePos += nChars;
+            else
             {
-               const char * message = null;
-               const char * inFileIncludedFrom = strstr(line, stringInFileIncludedFrom);
-               const char * from = strstr(line, stringFrom);
-               test.copyLenSingleBlankReplTrim(line, ' ', true, testLen);
-               if((t = strstr(line, (s=": recipe for target"))) && (t = strstr(t+strlen(s), (s2 = " failed"))) && (t+strlen(s2))[0] == '\0')
-                  ; // ignore this new gnu make error but what is it about?
-               else if(strstr(line, compiler.makeCommand) == line && line[lenMakeCommand] == ':')
+               linePos = 0;
+               if(line[0])
                {
-                  const char * module = strstr(line, "No rule to make target `");
-                  if(module)
+                  const char * message = null;
+                  const char * inFileIncludedFrom = strstr(line, stringInFileIncludedFrom);
+                  const char * from = strstr(line, stringFrom);
+                  test.copyLenSingleBlankReplTrim(line, ' ', true, testLen);
+                  if((t = strstr(line, (s=": recipe for target"))) && (t = strstr(t+strlen(s), (s2 = " failed"))) && (t+strlen(s2))[0] == '\0')
+                     ; // ignore this new gnu make error but what is it about?
+                  else if(strstr(line, compiler.makeCommand) == line && line[lenMakeCommand] == ':')
                   {
-                     char * end;
-                     module = strchr(module, '`') + 1;
-                     end = strchr(module, '\'');
-                     if(end)
+                     const char * module = strstr(line, "No rule to make target `");
+                     if(module)
                      {
-                        *end = '\0';
-                        ide.outputView.buildBox.Logf($"   %s: No such file or directory\n", module);
-                        // ide.outputView.buildBox.Logf("error: %s\n   No such file or directory\n", module);
-                        numErrors++;
+                        char * end;
+                        module = strchr(module, '`') + 1;
+                        end = strchr(module, '\'');
+                        if(end)
+                        {
+                           *end = '\0';
+                           ide.outputView.buildBox.Logf($"   %s: No such file or directory\n", module);
+                           // ide.outputView.buildBox.Logf("error: %s\n   No such file or directory\n", module);
+                           numErrors++;
+                        }
                      }
+                     //else
+                     //{
+                        //ide.outputView.buildBox.Logf("error: %s\n", line);
+                        //numErrors++;
+                     //}
                   }
-                  //else
-                  //{
-                     //ide.outputView.buildBox.Logf("error: %s\n", line);
-                     //numErrors++;
-                  //}
-               }
-               else if(strstr(test, "mkdir ") == test);
-               else if((t = strstr(line, "cd ")) && (t = strstr(line, "type ")) && (t = strstr(line, "nul ")) && (t = strstr(line, "copy ")) && (t = strstr(line, "cd ")));
-               else if(strstr(test, ear) == test);
-               else if(strstr(test, strip) == test);
-               else if(strstr(test, cc) == test || strstr(test, cxx) == test || strstr(test, ecp) == test || strstr(test, ecc) == test)
-               {
-                  char * module;
-                  bool isPrecomp = false;
-                  bool gotCC = false;
-
-                  if(strstr(test, cc) == test || strstr(test, cxx) == test)
-                  {
-                     module = strstr(line, " -c ");
-                     if(module) module += 4;
-                     gotCC = true;
-                  }
-                  else if(strstr(test, ecc) == test)
-                  {
-                     module = strstr(line, " -c ");
-                     if(module) module += 4;
-                     //module = line + 3;
-                     // Don't show GCC warnings about generated C code because it does not compile clean yet...
-                     compilingEC = 3;//2;
-                     gotCC = true;
-                  }
-                  else if(strstr(test, ecp) == test)
+                  else if(strstr(test, "mkdir ") == test);
+                  else if((t = strstr(line, "cd ")) && (t = strstr(line, "type ")) && (t = strstr(line, "nul ")) && (t = strstr(line, "copy ")) && (t = strstr(line, "cd ")));
+                  else if(strstr(test, ear) == test);
+                  else if(strstr(test, strip) == test);
+                  else if(strstr(test, cc) == test || strstr(test, cxx) == test || strstr(test, ecp) == test || strstr(test, ecc) == test)
                   {
-                     // module = line + 8;
-                     module = strstr(line, " -c ");
-                     if(module) module += 4;
-                     isPrecomp = true;
-                     compilingEC = 0;
-                     gotCC = true;
-                  }
+                     char * module;
+                     bool isPrecomp = false;
+                     bool gotCC = false;
+
+                     if(strstr(test, cc) == test || strstr(test, cxx) == test)
+                     {
+                        module = strstr(line, " -c ");
+                        if(module) module += 4;
+                        gotCC = true;
+                     }
+                     else if(strstr(test, ecc) == test)
+                     {
+                        module = strstr(line, " -c ");
+                        if(module) module += 4;
+                        //module = line + 3;
+                        // Don't show GCC warnings about generated C code because it does not compile clean yet...
+                        compilingEC = 3;//2;
+                        gotCC = true;
+                     }
+                     else if(strstr(test, ecp) == test)
+                     {
+                        // module = line + 8;
+                        module = strstr(line, " -c ");
+                        if(module) module += 4;
+                        isPrecomp = true;
+                        compilingEC = 0;
+                        gotCC = true;
+                     }
 
-                  loggedALine = true;
+                     loggedALine = true;
 
-                  if(module)
-                  {
-                     char * tokens[1];
-                     if(!compiling && !isPrecomp)
+                     if(module)
                      {
-                        ide.outputView.buildBox.Logf($"Compiling...\n");
-                        compiling = true;
+                        char * tokens[1];
+                        if(!compiling && !isPrecomp)
+                        {
+                           ide.outputView.buildBox.Logf($"Compiling...\n");
+                           compiling = true;
+                        }
+                        else if(!precompiling && isPrecomp)
+                        {
+                           ide.outputView.buildBox.Logf($"Generating symbols...\n");
+                           precompiling = true;
+                        }
+                        Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
+                        GetLastDirectory(tokens[0], moduleName);
+                        ide.outputView.buildBox.Logf("%s\n", moduleName);
                      }
-                     else if(!precompiling && isPrecomp)
+                     else if((module = strstr(line, " -o ")))
                      {
-                        ide.outputView.buildBox.Logf($"Generating symbols...\n");
-                        precompiling = true;
+                        compiling = false;
+                        precompiling = false;
+                        linking = true;
+                        ide.outputView.buildBox.Logf($"Linking...\n");
+                     }
+                     else
+                     {
+                        ide.outputView.buildBox.Logf("%s\n", line);
+                        if(strstr(line, "warning:") || strstr(line, "note:"))
+                           numWarnings++;
+                        else if(!gotCC && !strstr(line, "At top level") && !strstr(line, "In file included from") && !strstr(line, stringFrom))
+                           numErrors++;
                      }
-                     Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
-                     GetLastDirectory(tokens[0], moduleName);
-                     ide.outputView.buildBox.Logf("%s\n", moduleName);
-                  }
-                  else if((module = strstr(line, " -o ")))
-                  {
-                     compiling = false;
-                     precompiling = false;
-                     linking = true;
-                     ide.outputView.buildBox.Logf($"Linking...\n");
-                  }
-                  else
-                  {
-                     ide.outputView.buildBox.Logf("%s\n", line);
-                     if(strstr(line, "warning:") || strstr(line, "note:"))
-                        numWarnings++;
-                     else if(!gotCC && !strstr(line, "At top level") && !strstr(line, "In file included from") && !strstr(line, stringFrom))
-                        numErrors++;
-                  }
 
-                  if(compilingEC) compilingEC--;
-               }
-               else if(strstr(test, windres) == test)
-               {
-                  char * module;
-                  module = strstr(line, " ");
-                  if(module) module++;
-                  if(module)
+                     if(compilingEC) compilingEC--;
+                  }
+                  else if(strstr(test, windres) == test)
                   {
-                     char * tokens[1];
-                     char * dashF = strstr(module, "-F ");
-                     if(dashF)
+                     char * module;
+                     module = strstr(line, " ");
+                     if(module) module++;
+                     if(module)
                      {
-                        dashF+= 3;
-                        while(*dashF && *dashF != ' ') dashF++;
-                        while(*dashF && *dashF == ' ') dashF++;
-                        module = dashF;
+                        char * tokens[1];
+                        char * dashF = strstr(module, "-F ");
+                        if(dashF)
+                        {
+                           dashF+= 3;
+                           while(*dashF && *dashF != ' ') dashF++;
+                           while(*dashF && *dashF == ' ') dashF++;
+                           module = dashF;
+                        }
+                        Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
+                        GetLastDirectory(module, moduleName);
+                        ide.outputView.buildBox.Logf("%s\n", moduleName);
                      }
-                     Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
-                     GetLastDirectory(module, moduleName);
-                     ide.outputView.buildBox.Logf("%s\n", moduleName);
                   }
-               }
-               else if(strstr(test, ar) == test)
-                  ide.outputView.buildBox.Logf($"Building library...\n");
-               else if(strstr(test, ecs) == test)
-                  ide.outputView.buildBox.Logf($"Writing symbol loader...\n");
-               else
-               {
-                  if(linking || compiling || precompiling)
+                  else if(strstr(test, ar) == test)
+                     ide.outputView.buildBox.Logf($"Building library...\n");
+                  else if(strstr(test, ecs) == test)
+                     ide.outputView.buildBox.Logf($"Writing symbol loader...\n");
+                  else
                   {
-                     const char * start = inFileIncludedFrom ? inFileIncludedFrom + strlen(stringInFileIncludedFrom) : from ? from + strlen(stringFrom) : line;
-                     const char * colon = strstr(start, ":"); //, * bracket;
-                     if(colon && (colon[1] == '/' || colon[1] == '\\'))
-                        colon = strstr(colon + 1, ":");
-                     if(colon)
+                     if(linking || compiling || precompiling)
                      {
-                        const char * sayError = "";
-                        char moduleName[MAX_LOCATION], temp[MAX_LOCATION];
-                        char * pointer;
-                        char * error;
-                        int len = (int)(colon - start);
-                        char ext[MAX_EXTENSION];
-                        len = Min(len, MAX_LOCATION-1);
-                        // Don't be mistaken by the drive letter colon
-                        // Cut module name
-                        // TODO: need to fix colon - line gives char *
-                        // warning: incompatible expression colon - line (char *); expected int
-                        /*
-                        strncpy(moduleName, line, (int)(colon - line));
-                        moduleName[colon - line] = '\0';
-                        */
-                        strncpy(moduleName, start, len);
-                        moduleName[len] = '\0';
-                        // Remove stuff in brackets
-                        //bracket = strstr(moduleName, "(");
-                        //if(bracket) *bracket = '\0';
-
-                        GetLastDirectory(moduleName, temp);
-                        GetExtension(temp, ext);
-
-                        if(linking && (!strcmp(ext, "o") || !strcmp(ext, "a") || !strcmp(ext, "lib")))
+                        const char * start = inFileIncludedFrom ? inFileIncludedFrom + strlen(stringInFileIncludedFrom) : from ? from + strlen(stringFrom) : line;
+                        const char * colon = strstr(start, ":"); //, * bracket;
+                        if(colon && (colon[1] == '/' || colon[1] == '\\'))
+                           colon = strstr(colon + 1, ":");
+                        if(colon)
                         {
-                           char * cColon = strstr(colon+1, ":");
-                           if(cColon && (cColon[1] == '/' || cColon[1] == '\\'))
-                              cColon = strstr(cColon + 1, ":");
-                           if(cColon)
+                           const char * sayError = "";
+                           char moduleName[MAX_LOCATION], temp[MAX_LOCATION];
+                           char * pointer;
+                           char * error;
+                           int len = (int)(colon - start);
+                           char ext[MAX_EXTENSION];
+                           len = Min(len, MAX_LOCATION-1);
+                           // Don't be mistaken by the drive letter colon
+                           // Cut module name
+                           // TODO: need to fix colon - line gives char *
+                           // warning: incompatible expression colon - line (char *); expected int
+                           /*
+                           strncpy(moduleName, line, (int)(colon - line));
+                           moduleName[colon - line] = '\0';
+                           */
+                           strncpy(moduleName, start, len);
+                           moduleName[len] = '\0';
+                           // Remove stuff in brackets
+                           //bracket = strstr(moduleName, "(");
+                           //if(bracket) *bracket = '\0';
+
+                           GetLastDirectory(moduleName, temp);
+                           GetExtension(temp, ext);
+
+                           if(linking && (!strcmp(ext, "o") || !strcmp(ext, "a") || !strcmp(ext, "lib")))
                            {
-                              int len = (int)(cColon - (colon+1));
-                              char mName[MAX_LOCATION];
-                              len = Min(len, MAX_LOCATION-1);
-                              strncpy(mName, colon+1, len);
-                              mName[len] = '\0';
-                              GetLastDirectory(mName, temp);
-                              GetExtension(temp, ext);
-                              if(!strcmp(ext, "c") || !strcmp(ext, "cpp") || !strcmp(ext, "cxx") || !strcmp(ext, "ec"))
+                              char * cColon = strstr(colon+1, ":");
+                              if(cColon && (cColon[1] == '/' || cColon[1] == '\\'))
+                                 cColon = strstr(cColon + 1, ":");
+                              if(cColon)
                               {
-                                 colon = cColon;
-                                 strcpy(moduleName, mName);
+                                 int len = (int)(cColon - (colon+1));
+                                 char mName[MAX_LOCATION];
+                                 len = Min(len, MAX_LOCATION-1);
+                                 strncpy(mName, colon+1, len);
+                                 mName[len] = '\0';
+                                 GetLastDirectory(mName, temp);
+                                 GetExtension(temp, ext);
+                                 if(!strcmp(ext, "c") || !strcmp(ext, "cpp") || !strcmp(ext, "cxx") || !strcmp(ext, "ec"))
+                                 {
+                                    colon = cColon;
+                                    strcpy(moduleName, mName);
+                                 }
                               }
                            }
-                        }
-                        if(linking && (!strcmp(temp, "ld") || !strcmp(temp, "ld.exe")))
-                        {
-                           moduleName[0] = 0;
-                           if(strstr(colon, "skipping incompatible") || strstr(colon, "Recognised but unhandled"))
+                           if(linking && (!strcmp(temp, "ld") || !strcmp(temp, "ld.exe")))
                            {
-                              message = $"Linker Message: ";
-                              colon = line;
+                              moduleName[0] = 0;
+                              if(strstr(colon, "skipping incompatible") || strstr(colon, "Recognised but unhandled"))
+                              {
+                                 message = $"Linker Message: ";
+                                 colon = line;
+                              }
+                              else
+                              {
+                                 numErrors++;
+                                 message = $"Linker Error: ";
+                              }
                            }
-                           else
+                           else if(linking && (!strcmp(ext, "") || !strcmp(ext, "exe")))
                            {
-                              numErrors++;
-                              message = $"Linker Error: ";
+                              moduleName[0] = 0;
+                              colon = line;
+                              if(strstr(colon, "Warning:") == colon)
+                              {
+                                 message = $"Linker ";
+                                 numWarnings++;
+                              }
+                              else if(!strstr(line, "error:"))
+                              {
+                                 message = $"Linker Error: ";
+                                 numErrors++;
+                              }
                            }
-                        }
-                        else if(linking && (!strcmp(ext, "") || !strcmp(ext, "exe")))
-                        {
-                           moduleName[0] = 0;
-                           colon = line;
-                           if(strstr(colon, "Warning:") == colon)
+                           else
                            {
-                              message = $"Linker ";
-                              numWarnings++;
+                              strcpy(temp, topNode.path);
+                              PathCatSlash(temp, moduleName);
+                              MakePathRelative(temp, topNode.path, moduleName);
                            }
-                           else if(!strstr(line, "error:"))
-                           {
-                              message = $"Linker Error: ";
+                           error = strstr(line, "error:");
+                           if(!message && error && error > colon)
                               numErrors++;
-                           }
-                        }
-                        else
-                        {
-                           strcpy(temp, topNode.path);
-                           PathCatSlash(temp, moduleName);
-                           MakePathRelative(temp, topNode.path, moduleName);
-                        }
-                        error = strstr(line, "error:");
-                        if(!message && error && error > colon)
-                           numErrors++;
-                        else
-                        {
-                           // Silence warnings for compiled eC
-                           char * objDir = strstr(moduleName, objDirExp.dir);
-
-                           if(linking)
+                           else
                            {
-                              if((pointer = strstr(line, "undefined"))  ||
-                                   (pointer = strstr(line, "multiple definition")) ||
-                                   (pointer = strstr(line, "No such file")) ||
-                                   (pointer = strstr(line, "token")))
+                              // Silence warnings for compiled eC
+                              char * objDir = strstr(moduleName, objDirExp.dir);
+
+                              if(linking)
+                              {
+                                 if((pointer = strstr(line, "undefined"))  ||
+                                      (pointer = strstr(line, "multiple definition")) ||
+                                      (pointer = strstr(line, "No such file")) ||
+                                      (pointer = strstr(line, "token")))
+                                 {
+                                    strncat(moduleName, colon, pointer - colon);
+                                    sayError = "error: ";
+                                    colon = pointer;
+                                    numErrors++;
+                                 }
+                              }
+                              else if((pointer = strstr(line, "No such file")))
                               {
                                  strncat(moduleName, colon, pointer - colon);
                                  sayError = "error: ";
                                  colon = pointer;
                                  numErrors++;
                               }
-                           }
-                           else if((pointer = strstr(line, "No such file")))
-                           {
-                              strncat(moduleName, colon, pointer - colon);
-                              sayError = "error: ";
-                              colon = pointer;
-                              numErrors++;
-                           }
-                           else if(compilingEC == 1 || (objDir && objDir == moduleName))
-                           {
-                              bool skip = false;
-
-                              // Filter out these warnings caused by eC generated C code:
-
-                              // Declaration ordering bugs -- Awaiting topo sort implementation
-                                   if(strstr(line, "declared inside parameter list")) skip = true;
-                              else if(strstr(line, "its scope is only this definition")) skip = true;
-                              else if(strstr(line, "note: expected 'struct ") || strstr(line, "note: expected ‘struct "))
+                              else if(compilingEC == 1 || (objDir && objDir == moduleName))
                               {
-                                 #define STRUCT_A "'struct "
-                                 #define STRUCT_B "‘struct "
-                                 char * struct1, * struct2, ch1, ch2;
-                                 struct1 = strstr(line, STRUCT_A);
-                                 if(struct1) { struct1 += sizeof(STRUCT_A)-1; } else { struct1 = strstr(line, STRUCT_B); struct1 += sizeof(STRUCT_B)-1; };
+                                 bool skip = false;
 
-                                 struct2 = strstr(struct1, STRUCT_A);
-                                 if(struct2) { struct2 += sizeof(STRUCT_A)-1; } else { struct2 = strstr(struct1, STRUCT_B); if(struct2) struct2 += sizeof(STRUCT_B)-1; };
+                                 // Filter out these warnings caused by eC generated C code:
 
-                                 if(struct1 && struct2)
+                                 // Declaration ordering bugs -- Awaiting topo sort implementation
+                                      if(strstr(line, "declared inside parameter list")) skip = true;
+                                 else if(strstr(line, "its scope is only this definition")) skip = true;
+                                 else if(strstr(line, "note: expected 'struct ") || strstr(line, "note: expected ‘struct "))
                                  {
-                                    while(ch1 = *(struct1++), ch2 = *(struct2++), ch1 && ch2 && (ch1 == '_' || isalnum(ch1)) && (ch2 == '_' || isalnum(ch2)));
-                                    if(ch1 == ch2)
-                                       skip = true;
+                                    #define STRUCT_A "'struct "
+                                    #define STRUCT_B "‘struct "
+                                    char * struct1, * struct2, ch1, ch2;
+                                    struct1 = strstr(line, STRUCT_A);
+                                    if(struct1) { struct1 += sizeof(STRUCT_A)-1; } else { struct1 = strstr(line, STRUCT_B); struct1 += sizeof(STRUCT_B)-1; };
+
+                                    struct2 = strstr(struct1, STRUCT_A);
+                                    if(struct2) { struct2 += sizeof(STRUCT_A)-1; } else { struct2 = strstr(struct1, STRUCT_B); if(struct2) struct2 += sizeof(STRUCT_B)-1; };
+
+                                    if(struct1 && struct2)
+                                    {
+                                       while(ch1 = *(struct1++), ch2 = *(struct2++), ch1 && ch2 && (ch1 == '_' || isalnum(ch1)) && (ch2 == '_' || isalnum(ch2)));
+                                       if(ch1 == ch2)
+                                          skip = true;
+                                    }
                                  }
-                              }
-                              // Pointers warnings (eC should already warn about relevant problems, should cast in generated code)
-                              else if(strstr(line, "expected 'void **") || strstr(line, "expected ‘void **")) skip = true;
-                              else if(strstr(line, "from incompatible pointer type")) skip = true;
-                              else if(strstr(line, "comparison of distinct pointer types lacks a cast")) skip = true;
+                                 // Pointers warnings (eC should already warn about relevant problems, should cast in generated code)
+                                 else if(strstr(line, "expected 'void **") || strstr(line, "expected ‘void **")) skip = true;
+                                 else if(strstr(line, "from incompatible pointer type")) skip = true;
+                                 else if(strstr(line, "comparison of distinct pointer types lacks a cast")) skip = true;
 
-                              // For preprocessed code from objidl.h (MinGW-w64 headers)
-                              else if(strstr(line, "declaration does not declare anything")) skip = true;
+                                 // For preprocessed code from objidl.h (MinGW-w64 headers)
+                                 else if(strstr(line, "declaration does not declare anything")) skip = true;
 
-                              // Location information that could apply to ignored warnings
-                              else if(strstr(line, "In function '") || strstr(line, "In function ‘") ) skip = true;
-                              else if(strstr(line, "At top level")) skip = true;
-                              else if(strstr(line, "(near initialization for '") || strstr(line, "(near initialization for ‘")) skip = true;
+                                 // Location information that could apply to ignored warnings
+                                 else if(strstr(line, "In function '") || strstr(line, "In function ‘") ) skip = true;
+                                 else if(strstr(line, "At top level")) skip = true;
+                                 else if(strstr(line, "(near initialization for '") || strstr(line, "(near initialization for ‘")) skip = true;
 
-                              if(skip) continue;
-                              numWarnings++;
-                           }
-                           else if(strstr(line, "warning:"))
-                           {
-                              numWarnings++;
-                           }
-                        }
-                        if(message)
-                           ide.outputView.buildBox.Logf("   %s%s\n", message, colon);
-                        /*else if(this == ide.workspace.projects.firstIterator.data)
-                           ide.outputView.buildBox.Logf("   %s%s%s\n", moduleName, sayError, colon);*/
-                        else
-                        {
-                           char fullModuleName[MAX_LOCATION];
-                           FileAttribs found = 0;
-                           //Project foundProject = this;
-                           if(moduleName[0])
-                           {
-                              char * loc = strstr(moduleName, ":");
-                              if(loc) *loc = 0;
-                              strcpy(fullModuleName, topNode.path);
-                              PathCat(fullModuleName, moduleName);
-                              found = FileExists(fullModuleName);
-                              if(!found && !strcmp(ext, "c"))
+                                 if(skip) continue;
+                                 numWarnings++;
+                              }
+                              else if(strstr(line, "warning:"))
                               {
-                                 char ecName[MAX_LOCATION];
-                                 ChangeExtension(fullModuleName, "ec", ecName);
-                                 found = FileExists(ecName);
+                                 numWarnings++;
                               }
-                              if(!found)
+                           }
+                           if(message)
+                              ide.outputView.buildBox.Logf("   %s%s\n", message, colon);
+                           /*else if(this == ide.workspace.projects.firstIterator.data)
+                              ide.outputView.buildBox.Logf("   %s%s%s\n", moduleName, sayError, colon);*/
+                           else
+                           {
+                              char fullModuleName[MAX_LOCATION];
+                              FileAttribs found = 0;
+                              //Project foundProject = this;
+                              if(moduleName[0])
                               {
-                                 char path[MAX_LOCATION];
-                                 if(ide && ide.workspace)
+                                 char * loc = strstr(moduleName, ":");
+                                 if(loc) *loc = 0;
+                                 strcpy(fullModuleName, topNode.path);
+                                 PathCat(fullModuleName, moduleName);
+                                 found = FileExists(fullModuleName);
+                                 if(!found && !strcmp(ext, "c"))
                                  {
-                                    for(prj : ide.workspace.projects)
-                                    {
-                                       ProjectNode node;
-                                       MakePathRelative(fullModuleName, prj.topNode.path, path);
-
-                                       if((node = prj.topNode.FindWithPath(path, false)))
-                                       {
-                                          strcpy(fullModuleName, prj.topNode.path);
-                                          PathCatSlash(fullModuleName, node.path);
-                                          PathCatSlash(fullModuleName, node.name);
-                                          found = FileExists(fullModuleName);
-                                          if(found)
-                                          {
-                                             //foundProject = prj;
-                                             break;
-                                          }
-                                       }
-                                    }
-                                    if(!found && !strchr(moduleName, '/') && !strchr(moduleName, '\\'))
+                                    char ecName[MAX_LOCATION];
+                                    ChangeExtension(fullModuleName, "ec", ecName);
+                                    found = FileExists(ecName);
+                                 }
+                                 if(!found)
+                                 {
+                                    char path[MAX_LOCATION];
+                                    if(ide && ide.workspace)
                                     {
                                        for(prj : ide.workspace.projects)
                                        {
                                           ProjectNode node;
-                                          if((node = prj.topNode.Find(moduleName, false)))
+                                          MakePathRelative(fullModuleName, prj.topNode.path, path);
+
+                                          if((node = prj.topNode.FindWithPath(path, false)))
                                           {
                                              strcpy(fullModuleName, prj.topNode.path);
                                              PathCatSlash(fullModuleName, node.path);
@@ -1901,39 +1888,57 @@ private:
                                              }
                                           }
                                        }
+                                       if(!found && !strchr(moduleName, '/') && !strchr(moduleName, '\\'))
+                                       {
+                                          for(prj : ide.workspace.projects)
+                                          {
+                                             ProjectNode node;
+                                             if((node = prj.topNode.Find(moduleName, false)))
+                                             {
+                                                strcpy(fullModuleName, prj.topNode.path);
+                                                PathCatSlash(fullModuleName, node.path);
+                                                PathCatSlash(fullModuleName, node.name);
+                                                found = FileExists(fullModuleName);
+                                                if(found)
+                                                {
+                                                   //foundProject = prj;
+                                                   break;
+                                                }
+                                             }
+                                          }
+                                       }
                                     }
                                  }
-                              }
-                              if(found)
-                              {
-                                 MakePathRelative(fullModuleName, ide.workspace.projects.firstIterator.data.topNode.path, fullModuleName);
-                                 MakeSystemPath(fullModuleName);
+                                 if(found)
+                                 {
+                                    MakePathRelative(fullModuleName, ide.workspace.projects.firstIterator.data.topNode.path, fullModuleName);
+                                    MakeSystemPath(fullModuleName);
+                                 }
+                                 else
+                                    strcpy(fullModuleName, moduleName);
+                                 if(loc)
+                                 {
+                                    strcat(fullModuleName, ":");
+                                    strcat(fullModuleName, loc + 1);
+                                 }
                               }
                               else
-                                 strcpy(fullModuleName, moduleName);
-                              if(loc)
-                              {
-                                 strcat(fullModuleName, ":");
-                                 strcat(fullModuleName, loc + 1);
-                              }
+                                 fullModuleName[0] = 0;
+                              ide.outputView.buildBox.Logf("   %s%s%s%s\n", inFileIncludedFrom ? stringInFileIncludedFrom : from ? stringFrom : "", fullModuleName, sayError, colon);
                            }
-                           else
-                              fullModuleName[0] = 0;
-                           ide.outputView.buildBox.Logf("   %s%s%s%s\n", inFileIncludedFrom ? stringInFileIncludedFrom : from ? stringFrom : "", fullModuleName, sayError, colon);
+                        }
+                        else
+                        {
+                           ide.outputView.buildBox.Logf("%s\n", line);
+                           linking = compiling = precompiling = false;
                         }
                      }
                      else
-                     {
                         ide.outputView.buildBox.Logf("%s\n", line);
-                        linking = compiling = precompiling = false;
-                     }
                   }
-                  else
-                     ide.outputView.buildBox.Logf("%s\n", line);
+                  wait = false;
                }
-               wait = false;
             }
-            //printf("Done getting line\n");
             if(GetTime() - lastTime > 1.0 / PEEK_RESOLUTION) break;
          }
          //printf("Processing Input...\n");