compiler/libec: Patch to avoid warnings when strlen is being defined
authorJerome St-Louis <jerome@ecere.com>
Sun, 13 Jul 2014 08:48:16 +0000 (04:48 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 13 Jul 2014 08:48:16 +0000 (04:48 -0400)
compiler/bootstrap/libec/bootstrap/ast.c
compiler/libec/src/ast.ec

index ea6b9bd..471a1a1 100644 (file)
@@ -3680,7 +3680,7 @@ name[len] = 0;
 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
 }
 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(curContext->templateTypesOnly ? curContext->parent : curContext)->symbols, id->string);
-if(!symbol)
+if(!symbol && strcmp(id->string, "strlen"))
 {
 symbol = __extension__ ({
 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
index 9b56913..02b1229 100644 (file)
@@ -955,7 +955,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
 
                // Avoid memory leaks on duplicated symbols (BinaryTree::Add Would Fail)
                symbol = (Symbol)(curContext.templateTypesOnly ? curContext.parent : curContext).symbols.FindString(id.string);
-               if(!symbol)
+               if(!symbol && strcmp(id.string, "strlen")) // Avoid overriding our definition of strlen or our 'uintsize' warning override won't take effect
                {
                   symbol = Symbol { string = CopyString(id.string), type = ProcessType(specifiers, d.declarator) };
                   if(strstr(symbol.string, "::"))