Bug 532492

Summary: how about allowing memset(foo, 0, 0) without warning ?
Product: [Fedora] Fedora Reporter: Caolan McNamara <caolanm>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: drepper, jakub, schwab
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.11.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-25 03:19:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
like so none

Description Caolan McNamara 2009-11-02 16:16:20 UTC
Created attachment 367159 [details]
like so

Description of problem:
A memset where both arguments are 0 gets reported with "warning: memset used with constant zero length parameter; this could be due to transposed parameters"

Version-Release number of selected component (if applicable):
glibc-headers-2.10.90-25

How reproducible:
100%

Steps to Reproduce:
1. gcc -O2 -Wall -D_FORTIFY_SOURCE=2 memset(c, 0, 0);
  
Expected results:
No biggy, but with some templated/macroized code there's some circumstances where memset ends up with both args equal to 0, e.g. memset (foo, 0, capacity()). Easy fix in client code too of course, but how about eliding the warning about a 0 len if the other arg is definitely 0

Comment 1 Ulrich Drepper 2009-11-10 14:29:54 UTC
I applied the patch upstream.

Comment 2 Bug Zapper 2009-11-16 14:53:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Ulrich Drepper 2009-11-25 03:19:57 UTC
It's in rawhide.

Comment 4 Fedora Update System 2009-11-30 16:35:28 UTC
glibc-2.11-4 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/glibc-2.11-4

Comment 5 Fedora Update System 2010-01-12 23:42:32 UTC
glibc-2.11.1-1 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.