Kernel - Disabled -fno-builtins, removed some unneeded memcpy calls
authorJohn Hodge <[email protected]>
Fri, 11 Nov 2011 05:01:40 +0000 (13:01 +0800)
committerJohn Hodge <[email protected]>
Fri, 11 Nov 2011 05:01:40 +0000 (13:01 +0800)
Kernel/Makefile
Kernel/vfs/open.c
Modules/IPStack/routing.c
Modules/Makefile.tpl

index 0dee58d..93ad6b6 100644 (file)
@@ -21,7 +21,7 @@ MAKEDEP               = $(CC) -M
 CPPFLAGS       += -I./include -I./arch/$(ARCHDIR)/include -D_MODULE_NAME_=\"Kernel\"
 CPPFLAGS       += -DARCH=$(ARCH) -DARCHDIR=$(ARCHDIR) -DARCHDIR_IS_$(ARCHDIR)=1
 CPPFLAGS       += -DKERNEL_VERSION=$(KERNEL_VERSION)
-CFLAGS         += -Wall -Werror -fno-stack-protector -fno-builtin -Wstrict-prototypes -g
+CFLAGS         += -Wall -Werror -fno-stack-protector -Wstrict-prototypes -g
 CFLAGS         += -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wuninitialized
 LDFLAGS                += -T arch/$(ARCHDIR)/link.ld -g
 
index 1845b7a..340c9b2 100644 (file)
@@ -55,12 +55,9 @@ char *VFS_GetAbsPath(const char *Path)
        }
        
        // - Fetch ChRoot
-       if( chroot == NULL ) {
+       if( chroot == NULL )
                chroot = "";
-               chrootLen = 0;
-       } else {
-               chrootLen = strlen(chroot);
-       }
+       chrootLen = strlen(chroot);
        
        // Check if the path is already absolute
        if(Path[0] == '/') {
@@ -155,7 +152,8 @@ char *VFS_GetAbsPath(const char *Path)
                ret[iPos2] = 0;
 
        // Prepend the chroot
-       memcpy( ret, chroot, chrootLen );
+       if(chrootLen)
+               memcpy( ret, chroot, chrootLen );
        
        LEAVE('s', ret);
 //     Log_Debug("VFS", "VFS_GetAbsPath: RETURN '%s'", ret);
index 9e298a0..1cde444 100644 (file)
@@ -56,9 +56,9 @@ char *IPStack_RouteDir_ReadDir(tVFS_Node *Node, int Pos)
        }
        
        {
-                int    len = sprintf(NULL, "%i", rt->Node.Inode);
+                int    len = sprintf(NULL, "%i", (int)rt->Node.Inode);
                char    buf[len+1];
-               sprintf(buf, "%i", rt->Node.Inode);
+               sprintf(buf, "%i", (int)rt->Node.Inode);
                return strdup(buf);
        }
 }
index b31943e..04a0c04 100644 (file)
@@ -13,7 +13,7 @@ CPPFLAGS := -I$(ACESSDIR)/Kernel/include -I$(ACESSDIR)/Kernel/arch/$(ARCHDIR)/in
 CPPFLAGS += -DARCH=$(ARCH) -DARCH_is_$(ARCH) -DARCHDIR_is_$(ARCHDIR)
 CPPFLAGS += $(_CPPFLAGS)
 CPPFLAGS += $(LIBINCLUDES)
-CFLAGS := -std=gnu99 -Wall -Werror -fno-stack-protector -g -O3 -fno-builtin
+CFLAGS := -std=gnu99 -Wall -Werror -fno-stack-protector -g -O3
 
 ifneq ($(CATEGORY),)
        FULLNAME := $(CATEGORY)_$(NAME)

UCC git Repository :: git.ucc.asn.au