Closed Bug 566800 Opened 15 years ago Closed 15 years ago

GLContextProvider::ContextFormat() calls memset with arguments reversed, and ends up with a no-op.

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 567190

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

{ In function ‘void* memset(void*, int, size_t)’, inlined from ‘mozilla::gl::GLContextProvider::ContextFormat::ContextFormat(mozilla::gl::GLContextProvider::ContextFormat::StandardContextFormat)’ at ../../../dist/include/GLContextProvider.h:65, inlined from ‘(static initializers for /usr/include/bits/string3.h)’ at ../../../../mozilla/gfx/thebes/src/GLContext.cpp:55: /usr/include/bits/string3.h:83: 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 } Looks like the warning is right - unwrapping the inlining, the blamed line is: > 64 ContextFormat(const StandardContextFormat cf) { > 65 memset(this, sizeof(ContextFormat), 0); http://hg.mozilla.org/mozilla-central/annotate/6d70525ff299/gfx/thebes/public/GLContextProvider.h#l64 That's clearly trying to zero out |*this|. However, it ends up doing nothing, since 0 is actually passed in the |count| argument. (The 2nd and 3rd argument are swapped.) http://www.cplusplus.com/reference/clibrary/cstring/memset/
Whiteboard: [build_warning]
Attached patch fixSplinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #446150 - Flags: review?(vladimir)
It looks like bug 567190 has fixed this. (It was filed a few days after this bug, but it's the patch that got review & landed, so I'm duping this one to that one.)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Attachment #446150 - Flags: review?(vladimir)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: