[webkit-reviews] review granted: [Bug 23102] turn on unused parameter warnings in WebCore : [Attachment 26613] step 3 -- covers mostly arguments used only in assertions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 11 12:42:17 PST 2009


mitz at webkit.org has granted Darin Adler <darin at apple.com>'s request for review:
Bug 23102: turn on unused parameter warnings in WebCore
https://bugs.webkit.org/show_bug.cgi?id=23102

Attachment 26613: step 3 -- covers mostly arguments used only in assertions
https://bugs.webkit.org/attachment.cgi?id=26613&action=review

------- Additional Comments from mitz at webkit.org
>      setDatabaseVersion.begin();
>  
>      char userVersionSQL[32];
> -    int numBytes = snprintf(userVersionSQL, sizeof(userVersionSQL), "PRAGMA
user_version=%d", schemaVersion);
> -    ASSERT_UNUSED(numBytes, static_cast<int>(sizeof(userVersionSQL)) >=
numBytes);
> +    int unusedNumBytes = snprintf(userVersionSQL, sizeof(userVersionSQL),
"PRAGMA user_version=%d", schemaVersion);
> +    ASSERT_UNUSED(unusedNumBytes, static_cast<int>(sizeof(userVersionSQL))
>= unusedNumBytes);

Is there a reason to even call sprintf() if assertions are disabled? If not,
then both lines should be #if-ed to compile only when assertions are enabled.

r=me


More information about the webkit-reviews mailing list