[PATCH 0/2] ansi compile warning fixes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/2] ansi compile warning fixes

Carlo Marcelo Arenas Belon
The following patch series removes all compile warnings presented in
trunk if the compiled with "-ansi -pedantic" by enabling GNU extensions
in the examples/tests that will otherwise be missing them :

  PATCH 1/2: examples: declare source as GNU for strdup definition
  PATCH 2/2: tests: declare source as GNU for inet_aton definition

This series has to be applied on top of the one that removes all "pedantic"
warnings as it otherwise will be incomplete and won't avoid build failures
if using "-pedantic-errors" as reported in :

  http://lists.nongnu.org/archive/html/confuse-devel/2009-01/msg00004.html

Carlo
---
 examples/simple.c      |    1 +
 tests/suite_single.c   |    1 +
 tests/suite_validate.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)


_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] examples: declare source as GNU for strdup definition

Carlo Marcelo Arenas Belon

otherwise to show the following warning if compiled in -ansi mode :

  simple.c:34: warning: implicit declaration of function ‘strdup’
  simple.c:34: warning: assignment makes pointer from integer without a cast

Signed-off-by: Carlo Marcelo Arenas Belon <[hidden email]>
---
 examples/simple.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/examples/simple.c b/examples/simple.c
index 9a6ee51..76266f1 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <string.h>
 #include <stdlib.h>
 #include "confuse.h"

_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] tests: declare source as GNU for inet_aton definition

Carlo Marcelo Arenas Belon
In reply to this post by Carlo Marcelo Arenas Belon

otherwise to show the following warning if compiled in -ansi mode :

  suite_single.c:14: warning: implicit declaration of function ‘inet_aton’
  suite_validate.c:57: warning: implicit declaration of function ‘inet_aton’

Signed-off-by: Carlo Marcelo Arenas Belon <[hidden email]>
---
 tests/suite_single.c   |    1 +
 tests/suite_validate.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/tests/suite_single.c b/tests/suite_single.c
index ded643f..3806a46 100644
--- a/tests/suite_single.c
+++ b/tests/suite_single.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include "check_confuse.h"
 #include <string.h>
 #include <stdlib.h>
diff --git a/tests/suite_validate.c b/tests/suite_validate.c
index e29f511..d68923d 100644
--- a/tests/suite_validate.c
+++ b/tests/suite_validate.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include "check_confuse.h"
 #include <string.h>
 #include <sys/types.h>

_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel