Bug 532492 - how about allowing memset(foo, 0, 0) without warning ?
Summary: how about allowing memset(foo, 0, 0) without warning ?
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-02 16:16 UTC by Caolan McNamara
Modified: 2010-01-12 23:42 UTC (History)
3 users (show)

Fixed In Version: 2.11.1-1
Clone Of:
Environment:
Last Closed: 2009-11-25 03:19:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
like so (462 bytes, patch)
2009-11-02 16:16 UTC, Caolan McNamara
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.