Subject: | Suppress warnings from gcc |
Attached are 2 patches to suppress these warnings from gcc:
perl_libyaml.c:154: warning: passing arg 2 of `Perl_sv_2mortal' from incompatible pointer type
perl_libyaml.c:641: warning: assignment discards qualifiers from pointer target type
perl_libyaml.c:701: warning: assignment discards qualifiers from pointer target type
Subject: | 0003-Add-some-consts-to-silence-gcc-warnings.patch |
From e27ed05b0d909c901b940309c05378c1238eaa82 Mon Sep 17 00:00:00 2001
From: Gisle Aas <gisle@activestate.com>
Date: Sun, 14 Feb 2010 00:15:14 -0800
Subject: [PATCH 3/4] Add some consts to silence gcc warnings
perl_libyaml.c:641: warning: assignment discards qualifiers from pointer target type
perl_libyaml.c:701: warning: assignment discards qualifiers from pointer target type
---
LibYAML/perl_libyaml.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/LibYAML/perl_libyaml.c b/LibYAML/perl_libyaml.c
index 1326eee..811e3a5 100644
--- a/LibYAML/perl_libyaml.c
+++ b/LibYAML/perl_libyaml.c
@@ -608,7 +608,7 @@ dump_node(perl_yaml_dumper_t *dumper, SV *node)
{
yaml_char_t *anchor = NULL;
yaml_char_t *tag = NULL;
- char *class = NULL;
+ const char *class = NULL;
if (SvTYPE(node) == SVt_PVGV) {
SV **svr;
@@ -692,7 +692,7 @@ yaml_char_t *
get_yaml_tag(SV *node)
{
yaml_char_t *tag;
- char *class;
+ const char *class;
char *kind = "";
if (! (
sv_isobject(node) ||
--
1.6.2.rc2
Subject: | 0002-Cast-away-the-incompatible-pointer-type-warning.patch |
From f59f67386e8af76eb0146494a15a2af86d10bc03 Mon Sep 17 00:00:00 2001
From: Gisle Aas <gisle@activestate.com>
Date: Sun, 14 Feb 2010 00:12:09 -0800
Subject: [PATCH 2/4] Cast away the incompatible pointer type warning
gcc says:
perl_libyaml.c:154: warning: passing arg 2 of `Perl_sv_2mortal' from incompatible pointer type
---
LibYAML/perl_libyaml.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/LibYAML/perl_libyaml.c b/LibYAML/perl_libyaml.c
index fe1d961..1326eee 100644
--- a/LibYAML/perl_libyaml.c
+++ b/LibYAML/perl_libyaml.c
@@ -151,7 +151,7 @@ Load(SV *yaml_sv)
);
loader.anchors = newHV();
- sv_2mortal(loader.anchors);
+ sv_2mortal((SV*)loader.anchors);
/* Keep calling load_node until end of stream */
while (1) {
--
1.6.2.rc2