nano-devel
[Top][All Lists]
Advanced

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

Build warning about duplicate definition of NOTHING


From: Hans-Bernhard Bröker
Subject: Build warning about duplicate definition of NOTHING
Date: Tue, 2 Feb 2021 02:22:11 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Dear nano developers,

a build from a tarball made from current git sources would now trigger a macro redefinition warning because of this change to src/definitions.h by commit 3ea2694d9c0f590fda7973d519936b0578eac449:

-#define CNONE           (1<<1)
+#define NOTHING      (1<<1)

This definition of "NOTHING" collides with the one in generated file "revision.h" in case the configury did not detect a build from git:

#define NOTHING "from tarball"

Generally speaking I would advise against defining globally visible enums as macros, and against doing either without any kind of name-space prefix.

As an aside, I only noticed this because the detection logic for a build from git fails in an out-of-tree build. It checks for the presence of a file in the build root which only exists in the source root. This should help:

diff --git a/configure.ac b/configure.ac
index 4d2a5c19..09c6d0c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
 dnl Whether this is a git repository.

 AC_MSG_CHECKING([whether building from git])
-if test -f roll-a-release.sh ; then
+if test -f $srcdir/roll-a-release.sh ; then
        AC_MSG_RESULT([yes])
        from_git=yes
 else


Hope this helps

Hans-Bernhard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]