Changeset 32d544c in git


Ignore:
Timestamp:
Jan 2, 2012, 1:01:03 PM (11 years ago)
Author:
Jan Engelhardt <jengelh@…>
Branches:
(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
17248139b99e23ade035b64dc930bb8a6a0e857e
Parents:
838f56f282a80f908d7d7f3fee81e986ed1c0fab
git-author:
Jan Engelhardt <jengelh@inai.de>2012-01-02 13:01:03+01:00
git-committer:
Jan Engelhardt <jengelh@inai.de>2022-07-17 10:15:38+02:00
Message:
src: resolve strict-aliasing violation in ndbm.cc

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]
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/links/ndbm.cc

    r838f56 r32d544c  
    281281#endif
    282282    }
    283     if (((short *)db->dbm_pagbuf)[0] != 0)
     283    short tmp;
     284    memcpy(&tmp, db->dbm_pagbuf, sizeof(tmp));
     285    if (tmp != 0)
    284286    {
    285287      item = makdatum(db->dbm_pagbuf, db->dbm_keyptr);
Note: See TracChangeset for help on using the changeset viewer.