Issue 111747 - svl: invalid use of memset
Summary: svl: invalid use of memset
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: bjoern.michaelsen
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 11:10 UTC by bjoern.michaelsen
Modified: 2017-05-20 10:23 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bjoern.michaelsen 2010-05-21 11:10:35 UTC
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 rightfully complains about broken usage of memset:

In function 'void* memset(void*, int, size_t)',
    inlined from 'SfxULongRanges& SfxULongRanges::operator/=(const
SfxULongRanges&)' at ..../svl/source/items/nranges.cxx:693:
/usr/include/bits/string3.h:82: warning: call to '__warn_memset_zero_len'
declared with attribute warning: memset used with constant zero length
parameter; this could be due to transposed parameters

In function 'void* memset(void*, int, size_t)',
    inlined from 'SfxULongRanges& SfxULongRanges::operator-=(const
SfxULongRanges&)' at ..../svl/source/items/nranges.cxx:483:
/usr/include/bits/string3.h:82: warning: call to '__warn_memset_zero_len'
declared with attribute warning: memset used with constant zero length
parameter; this could be due to transposed parameters

In both cases the memset is directly followed by a memcpy, so it is superfluous
anyway and should simply be removed.

Assigned to mst because he has a fitting cws at hand.
Comment 1 mst.ooo 2010-05-21 14:28:14 UTC
fixed in cws sw33bf04
http://hg.services.openoffice.org/hg/cws/sw33bf04/rev/ba6375961ba4
Comment 2 mst.ooo 2010-05-21 14:41:13 UTC
please verify
Comment 3 bjoern.michaelsen 2010-05-27 10:57:03 UTC
verified