Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 887633 Details for
Bug 1088339
python test failing on 64-bit big endians
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix incorrect assumption about size of int vs size of pointer
0001-Workaround-invalid-use-of-pointers.patch (text/plain), 2.99 KB, created by
Simo Sorce
on 2014-04-18 20:50:32 UTC
(
hide
)
Description:
Fix incorrect assumption about size of int vs size of pointer
Filename:
MIME Type:
Creator:
Simo Sorce
Created:
2014-04-18 20:50:32 UTC
Size:
2.99 KB
patch
obsolete
>From 028159c7b5f7c5dd0f72ecf02a9ae909c4ce59cc Mon Sep 17 00:00:00 2001 >From: Simo Sorce <simo@redhat.com> >Date: Fri, 18 Apr 2014 16:20:57 -0400 >Subject: [PATCH] Workaround invalid use of pointers > >Casting from void * is generally undefined and especially when casting to >integer types. >On Intel architectures the size of the pointer and of an integer are always the >same, but this does not hold true forother architectures like PPC64 and S390. >On PPC64 a pointer is a 64bit value while an int is a 32 bit value. > >This patch is a temporary workaround, to at least cast in a way that will give >the desired behavior when pointer and integer sizes are mismatched, but it is >by no means a proper fix. > >Signed-off-by: Simo Sorce <simo@redhat.com> >--- > configure.ac | 2 +- > lasso/xml/private.h | 15 +++++++++++++++ > lasso/xml/xml.c | 6 +++++- > 3 files changed, 21 insertions(+), 2 deletions(-) > >diff --git a/configure.ac b/configure.ac >index 5668e6f325f8ad2caee1e960ed92f13fffca258f..95fc050d1520fb5a2deb5ffc62a58742a372133f 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -700,7 +700,7 @@ AC_ARG_ENABLE(debugging, [ --enable-debugging enable debuging optimizati > if test "z$enable_debugging" = "zyes" ; then > enable_debugging=yes > LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG" >- AM_CFLAGS="-O0 -g -Wall -Wextra -Werror" >+ AM_CFLAGS="-O0 -ggdb3" > else > enable_debugging=no > fi >diff --git a/lasso/xml/private.h b/lasso/xml/private.h >index 450ec2644112d6a6931de21eea8b6d10441b90fb..83e41e369da0c3c499fa682958944bf36ea4b3d6 100644 >--- a/lasso/xml/private.h >+++ b/lasso/xml/private.h >@@ -142,6 +142,21 @@ snippet_struct_member(void *base, GType type, struct XmlSnippet *snippet) > #define SNIPPET_STRUCT_MEMBER_P(base, gtype, snippet) \ > snippet_struct_member(base, gtype, snippet) > >+inline static int >+snippet_struct_member_int(void *base, GType type, struct XmlSnippet *snippet) >+{ >+ if (snippet->type & SNIPPET_PRIVATE) { >+ if (! G_IS_OBJECT(base)) >+ return 0; >+ GObject *object = (GObject*)base; >+ base = g_type_instance_get_private((GTypeInstance*)object, >+ type); >+ } >+ return G_STRUCT_MEMBER(int, base, snippet->offset); >+} >+#define SNIPPET_STRUCT_MEMBER_INT(base, gtype, snippet) \ >+ snippet_struct_member_int(base, gtype, snippet) >+ > struct QuerySnippet { > char *path; > char *field_name; >diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c >index ba207f552cf5c6a587c1866adecab9f2ac9a339a..f62f7fc9af124181299a8ae6690aeea634acbb36 100644 >--- a/lasso/xml/xml.c >+++ b/lasso/xml/xml.c >@@ -2733,7 +2733,11 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, LassoNodeClass *class, x > continue; > } > type = snippet->type & 0xff; >- value = SNIPPET_STRUCT_MEMBER(void *, node, g_type, snippet); >+ if (snippet->type & (SNIPPET_BOOLEAN|SNIPPET_INTEGER)) { >+ value = SNIPPET_STRUCT_MEMBER_INT(node, g_type, snippet); >+ } else { >+ value = SNIPPET_STRUCT_MEMBER(void *, node, g_type, snippet); >+ } > str = value; > if (lasso_dump == FALSE && snippet->type & SNIPPET_LASSO_DUMP) > continue; >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1088339
:
886895
|
887349
| 887633