Bug 861704 - acpi.c still has transposed memset() args
acpi.c still has transposed memset() args
Product: Fedora
Classification: Fedora
Component: acpi (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Johan Swensson
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-09-30 03:03 EDT by Bruce Jerrick
Modified: 2013-10-29 16:53 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-29 16:53:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bruce Jerrick 2012-09-30 03:03:06 EDT
Description of problem:
The second and third args of the menset() call in acpi.c are transposed.
GCC knows this and fixes them (or at least it used to), but it would be
better to clean it up.

Version-Release number of selected component:
acpi-1.5-4.fc18.src.rpm		# and earlier

How reproducible:

Steps to Reproduce:
Either 'rpmbuild -bc' the acpi package from SRPM and look for the warnings:

    "warning: memset used with constant zero length parameter; this could be
     due to transposed parameters"

Or just examine the code and compare it to the man page:

    $ grep memset acpi.c
           memset(trip, sizeof trip, 0);
                        ^^^^^^^^^^^  ^

    $ man memset | fgrep 'void *memset'
           void *memset(void *s, int c, size_t n);
                                 ^^^^^  ^^^^^^^^

Mr. Posix says the same thing ('man -s3p memset').

Actual results:
Compiler warnings re memset().

Expected results:
No such warning.

Additional info:
This is with gcc-4.7.0-5.fc17, but it's been happening since F15 (and
probably earlier).

(BTW, the GCC warning should use the term "argument" -- "parameter" means
a formal, not actual, argument.)
Comment 1 Johan Swensson 2013-10-29 16:53:27 EDT
This warning is no longer present in latest rawhide build.

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