This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/5806] New: wrong comment in strlen() and other functions


strlen() and similar functions use some cool magic to determine whether any
bytes of an integer is zero. This magic is explained in a long comment in all
these source files. Part of this comment is:

         1) Is this safe?  Will it catch all the zero bytes?
         Suppose there is a byte with all zeros.  Any carry bits
         propagating from its left will fall into the hole at its
         least significant bit and stop. [...]

"propagating from its left" is wrong, it should be "propagating from its right".

In glibc-2.7 there are 14 files that contain this typo. Luckily the wording and
the formatting of the paragraph is exactly the same everywhere. I don't send a
patch because that might easily get outdated or miss some newly added files.
Rather, please do a combo of grep and sed or whatever similar tools to fix these.

-- 
           Summary: wrong comment in strlen() and other functions
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P3
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: egmont at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5806

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]