Skip to contentSkip to conversation

conntrack-tools: 1 pending fix

PATCH In review Jan Engelhardt 3 participants 6 messages May 31, 2012 netfilter

lore
Share & tools
lore
#0 lore raw

The following changes since commit d44489648c1a56d543a84bbebe455227bb25cf34:

conntrackd: fix compilation in src/parse.c (2012-05-28 14:06:48 +0200)

are available in the git repository at:
git://git.inai.de/conntrack-tools fix

Jan Engelhardt (1):
conntrackd: resolve a compiler error

 src/parse.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
#1 lore raw

PATCH 1/1 conntrackd: resolve a compiler error

Observed with gcc-4.7/glibc-2.15 and conntrack-tools-1.2.1:

CC parse.o
parse.c: In function 'msg2ct':
parse.c:258:34: error: 'NULL' undeclared (first use in this function)
parse.c:258:34: note: each undeclared identifier is reported only once for each function it appears in parse.c: In function 'msg2exp':
parse.c:438:16: error: 'NULL' undeclared (first use in this function)

NULL is in stdio.h.

---
 src/parse.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
src/parse.c +1 -0
index 1b83f81..391bf38 100644
@@ -17,6 +17,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <stdio.h>
 #include "network.h"
 
 #include <stdlib.h>
Signature · 1 line
1.7.7
#2 lore raw

Re: [PATCH] conntrackd: resolve a compiler error

Hi Jan,

Quoted 8 lines · Jan Engelhardt

Observed with gcc-4.7/glibc-2.15 and conntrack-tools-1.2.1:

CC parse.o
parse.c: In function 'msg2ct':
parse.c:258:34: error: 'NULL' undeclared (first use in this function)
parse.c:258:34: note: each undeclared identifier is reported only once for each function it appears in parse.c: In function 'msg2exp':
parse.c:438:16: error: 'NULL' undeclared (first use in this function)

Similar patch was already applied.

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=d44489648c1a56d543a84bbebe455227bb25cf34

This was spotted a couple of days ago by Mandriva people.

Thanks anyway!

maintainer
#3 lore raw

Re: [PATCH] conntrackd: resolve a compiler error

Quoted 12 lines · Pablo Neira Ayuso

Hi Jan,

Quoted 8 lines · Jan Engelhardt

Observed with gcc-4.7/glibc-2.15 and conntrack-tools-1.2.1:

CC parse.o
parse.c: In function 'msg2ct':
parse.c:258:34: error: 'NULL' undeclared (first use in this function)
parse.c:258:34: note: each undeclared identifier is reported only once for each function it appears in parse.c: In function 'msg2exp':
parse.c:438:16: error: 'NULL' undeclared (first use in this function)

Quoted 3 lines

Similar patch was already applied.

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=d44489648c1a56d543a84bbebe455227bb25cf34

NULL is defined in stddef.h, stdlib.h does not necessarily pull that header in, too.

Jan, does conntrackd build when you replace the stdlib.h include with stddef.h?

#4 lore raw

Re: [PATCH] conntrackd: resolve a compiler error

Quoted 8 lines · Florian Westphal
Quoted 8 lines
Quoted 7 lines

CC parse.o
parse.c: In function 'msg2ct':
parse.c:258:34: error: 'NULL' undeclared (first use in this function)
parse.c:258:34: note: each undeclared identifier is reported only once for each function it appears in parse.c: In function 'msg2exp':
parse.c:438:16: error: 'NULL' undeclared (first use in this function)

Quoted 6 lines
Quoted 3 lines

Similar patch was already applied.

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=d44489648c1a56d543a84bbebe455227bb25cf34

NULL is defined in stddef.h, stdlib.h does not necessarily pull that header in, too.

I believe that the C standard defines that NULL has to become available through (at least) stdio.h. Though wikipedia may not always be authoritative, I will use it as an excuse now: http://en.wikipedia.org/wiki/Stdio.h

So if #include <stddef.h> makes NULL available, good for glibc, but it may not satisfy certain implementations.

#5 lore raw

Re: [PATCH] conntrackd: resolve a compiler error

Quoted 17 lines · Jan Engelhardt
Quoted 8 lines · Florian Westphal
Quoted 8 lines
Quoted 7 lines

CC parse.o
parse.c: In function 'msg2ct':
parse.c:258:34: error: 'NULL' undeclared (first use in this function)
parse.c:258:34: note: each undeclared identifier is reported only once for each function it appears in parse.c: In function 'msg2exp':
parse.c:438:16: error: 'NULL' undeclared (first use in this function)

Quoted 6 lines
Quoted 3 lines

Similar patch was already applied.

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=d44489648c1a56d543a84bbebe455227bb25cf34

NULL is defined in stddef.h, stdlib.h does not necessarily pull that header in, too.

Quoted 6 lines

I believe that the C standard defines that NULL has to become available through (at least) stdio.h. Though wikipedia may not always be authoritative, I will use it as an excuse now: http://en.wikipedia.org/wiki/Stdio.h

So if #include <stddef.h> makes NULL available, good for glibc, but it may not satisfy certain implementations.

As soon the compilation works, I'll be happy to use the more precise header. Send me one patch upon the current git HEAD, I'll take it.