Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
singular
0001-src-resolve-strict-aliasing-violation-in-n...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-src-resolve-strict-aliasing-violation-in-ndbm.cc.patch of Package singular
From 32d544c08aef0445d878dff8b37cf0c13dd8c8bf Mon Sep 17 00:00:00 2001 From: Jan Engelhardt <jengelh@inai.de> Date: Mon, 2 Jan 2012 13:01:03 +0100 Subject: [PATCH] src: resolve strict-aliasing violation in ndbm.cc References: https://github.com/Singular/Singular/pull/1148 gcc-4.6 warned: ndbm.cc: In function 'datum dbm_nextkey(DBM*)': ndbm.cc:294:36: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] --- Singular/links/ndbm.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Singular/links/ndbm.cc b/Singular/links/ndbm.cc index 01f1f093b..1d40e0f4e 100644 --- a/Singular/links/ndbm.cc +++ b/Singular/links/ndbm.cc @@ -280,7 +280,9 @@ datum dbm_nextkey(DBM *db) db->dbm_flags |= _DBM_IOERR; #endif } - if (((short *)db->dbm_pagbuf)[0] != 0) + short tmp; + memcpy(&tmp, db->dbm_pagbuf, sizeof(tmp)); + if (tmp != 0) { item = makdatum(db->dbm_pagbuf, db->dbm_keyptr); if (item.dptr != NULL) -- 2.37.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor