[bug#35040] : Fix compilation warning

Message ID CAOYpmvoVFPv8Wwm7iV_VV6so-mASc+gi0HNmeYtwGq3wz8oZMA@mail.gmail.com
State Accepted
Headers show
Series [bug#35040] : Fix compilation warning | expand

Commit Message

guy fleury iteriteka March 29, 2019, 1:24 p.m. UTC
hi guix,

this patch fix compilation warning of libstore.a
i don't know this is a right way to do that.i 'm not yet
a good ;)

Comments

guy fleury iteriteka March 29, 2019, 1:52 p.m. UTC | #1
hi,

the compile warning message fix by that patch
-----------------------------------------------------------------------------
 CXX      nix/libstore/libstore_a-optimise-store.o
  CXX      nix/libstore/libstore_a-local-store.o
In file included from nix/libstore/local-store.cc:32:0:
/home/guy/.guix-profile/include/linux/fs.h:33:0: warning: "BLOCK_SIZE"
redefine
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 ^
In file included from nix/libstore/local-store.cc:28:0:
/home/guy/.guix-profile/include/sys/mount.h:27:0: note: this is the
location of
 #define BLOCK_SIZE 1024
 ^
In file included from nix/libstore/local-store.cc:32:0:
/home/guy/.guix-profile/include/linux/fs.h:108:0: warning: "MS_RDONLY"
redefine
 #define MS_RDONLY  1 /* Mount read-only */
 ^
In file included from nix/libstore/local-store.cc:28:0:
/home/guy/.guix-profile/include/sys/mount.h:36:0: note: this is the
location of
 #define MS_RDONLY MS_RDONLY


Le ven. 29 mars 2019 à 14:24, Guy fleury <hoonandon@gmail.com> a écrit :

> hi guix,
>
> this patch fix compilation warning of libstore.a
> i don't know this is a right way to do that.i 'm not yet
> a good ;)
>
>
>

Patch

From c20c3dbda40bfa9998ea0dd5396fda3951107d22 Mon Sep 17 00:00:00 2001
From: guy fleury iteriteka <hoonandon@gmail.com>
Date: Fri, 29 Mar 2019 13:59:21 +0100
Subject: [PATCH] Fix compilation warning

* Use undef preprocessor to disable some macro defined
  in sys/mount.h and redefined in linux/fs.h.
---
 nix/libstore/local-store.cc | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc
index 892d930..bf38d8e 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -29,6 +29,44 @@ 
 #endif
 
 #if HAVE_LINUX_FS_H
+
+#undef BLKRASET
+#undef BLOCK_SIZE
+#undef MS_RDONLY
+#undef MS_NOSUID
+#undef MS_NODEV
+#undef MS_NOEXEC
+#undef MS_SYNCHRONOUS
+#undef MS_REMOUNT
+#undef MS_MANDLOCK
+#undef MS_DIRSYNC
+#undef MS_NOATIME
+#undef MS_NODIRATIME
+#undef MS_BIND
+#undef MS_MOVE
+#undef MS_REC
+#undef MS_SILENT
+#undef MS_POSIXACL
+#undef MS_UNBINDABLE
+#undef MS_PRIVATE
+#undef MS_SLAVE
+#undef MS_SHARED
+#undef MS_RELATIME
+#undef MS_KERNMOUNT
+#undef MS_I_VERSION
+#undef MS_STRICTATIME
+#undef MS_LAZYTIME
+#undef MS_ACTIVE
+#undef MS_NOUSER
+#undef MS_RMT_MASK
+#undef MS_MGC_VAL
+#undef BLKROSET
+#undef BLKROGET
+#undef BLKRRPART
+#undef BLKGETSIZE
+#undef BLKFLSBUF
+#undef BLKRAGET
+
 #include <linux/fs.h>
 #include <sys/ioctl.h>
 #include <errno.h>
-- 
2.20.1