[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v3 1/5] lib/vfscore, lib/*fs: Ignore incompatible function pointer typecast





On 27.09.19 14:05, Sharan Santhanam wrote:
Hello Simon,

This patch is fine for most parts. There is minor comment..

Please find the comment inline:

Thanks & Regards

Sharan

On 9/24/19 12:07 PM, Simon Kuenzer wrote:
Vnode operations are implemented with function calls. In order to stub
some of the operations a no-op function is filled to those struct
entries. Such a stub function just returns an error code that tells that
the functionality is not implemented. However, the function signature
may not match with the stubbed vnode operation, so it is typecasted.
GCC 8 introduces a warning when function pointer typecasts are
incompatible. This patch adds a CFLAG to ignore this warning for
vfscore and all current filesystem implementations.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
  lib/9pfs/Makefile.uk    | 2 ++
  lib/devfs/Makefile.uk   | 2 ++
  lib/ramfs/Makefile.uk   | 2 ++
  lib/vfscore/Makefile.uk | 2 ++
  4 files changed, 8 insertions(+)

diff --git a/lib/9pfs/Makefile.uk b/lib/9pfs/Makefile.uk
index 9d4dfb57..8a667efa 100644
--- a/lib/9pfs/Makefile.uk
+++ b/lib/9pfs/Makefile.uk
@@ -1,4 +1,6 @@
  $(eval $(call addlib_s,lib9pfs,$(CONFIG_LIB9PFS)))
+LIB9PFS_CFLAGS-$(call gcc_version_ge,8,0) += -Wno-cast-function-type
+
  LIB9PFS_SRCS-y += $(LIB9PFS_BASE)/9pfs_vfsops.c
  LIB9PFS_SRCS-y += $(LIB9PFS_BASE)/9pfs_vnops.c
diff --git a/lib/devfs/Makefile.uk b/lib/devfs/Makefile.uk
index f89e6577..c496fd56 100644
--- a/lib/devfs/Makefile.uk
+++ b/lib/devfs/Makefile.uk
@@ -2,5 +2,7 @@ $(eval $(call addlib_s,libdevfs,$(CONFIG_LIBDEVFS)))
  CINCLUDES-y += -I$(LIBDEVFS_BASE)/include
+LIBDEVFS_CFLAGS-$(call gcc_version_ge,8,0) += -Wno-cast-function-type
+
  LIBDEVFS_SRCS-y += $(LIBDEVFS_BASE)/device.c
  LIBDEVFS_SRCS-y += $(LIBDEVFS_BASE)/devfs_vnops.c
diff --git a/lib/ramfs/Makefile.uk b/lib/ramfs/Makefile.uk
index 9a443358..bec0a957 100644
--- a/lib/ramfs/Makefile.uk
+++ b/lib/ramfs/Makefile.uk
@@ -1,4 +1,6 @@
  $(eval $(call addlib_s,libramfs,$(CONFIG_LIBRAMFS)))
+LIBRAMFS_CFLAGS-$(call gcc_version_ge,8,0) += -Wno-cast-function-type
+
  LIBRAMFS_SRCS-y += $(LIBRAMFS_BASE)/ramfs_vfsops.c
  LIBRAMFS_SRCS-y += $(LIBRAMFS_BASE)/ramfs_vnops.c
diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index e36c9217..1e5fc114 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -2,6 +2,8 @@ $(eval $(call addlib_s,libvfscore,$(CONFIG_LIBVFSCORE)))
  CINCLUDES-y += -I$(LIBVFSCORE_BASE)/include
+LIBVFSCORE_CFLAGS-$(call gcc_version_ge,8,0) += -Wno-cast-function-type
There is a duplicate definition specific to the pipe.c at line 20. This can be removed or we specify the warning specific to the pipe.c alone.

Sorry, I did not noticed this. I think it makes sense to remove it from line 20. Especially since that one is not checking the GCC version which may cause the build fail with an older version.

+
  LIBVFSCORE_SRCS-y += $(LIBVFSCORE_BASE)/fd.c
  LIBVFSCORE_SRCS-y += $(LIBVFSCORE_BASE)/file.c
  LIBVFSCORE_SRCS-y += $(LIBVFSCORE_BASE)/stdio.c

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.