Bug 171851 - [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp
Summary: [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: Hyungwook Lee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-09 00:27 PDT by Hyungwook Lee
Modified: 2017-05-10 07:05 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.96 KB, patch)
2017-05-09 00:31 PDT, Hyungwook Lee
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hyungwook Lee 2017-05-09 00:27:28 PDT
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp: In function ‘size_t WebCore::curveSize(WebCore::CryptoKeyEC::NamedCurve)’:
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp: In function ‘const char* WebCore::curveName(WebCore::CryptoKeyEC::NamedCurve)’:
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:58:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp: In function ‘unsigned int WebCore::uncompressedPointSizeForCurve(WebCore::CryptoKeyEC::NamedCurve)’:
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:68:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp: In function ‘unsigned int WebCore::uncompressedFieldElementSizeForCurve(WebCore::CryptoKeyEC::NamedCurve)’:
../../Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:78:1: warning: control reaches end of non-void function [-Wreturn-type]
Comment 1 Hyungwook Lee 2017-05-09 00:31:09 PDT
Created attachment 309483 [details]
Patch
Comment 2 Michael Catanzaro 2017-05-09 10:09:55 PDT
Comment on attachment 309483 [details]
Patch

Actually, I'll make a topic about this on webkit-dev, since we should find a standard way of handling this very common cause of warnings. I've been fixing these by adding a RELEASE_ASSERT_NOT_REACHED() in the default case and not having any code below the switch.
Comment 3 Michael Catanzaro 2017-05-09 12:21:02 PDT
See https://lists.webkit.org/pipermail/webkit-dev/2017-May/029023.html

So far, it looks like most people are favoring the approach you took here.
Comment 4 WebKit Commit Bot 2017-05-10 07:05:15 PDT
Comment on attachment 309483 [details]
Patch

Clearing flags on attachment: 309483

Committed r216581: <http://trac.webkit.org/changeset/216581>
Comment 5 WebKit Commit Bot 2017-05-10 07:05:16 PDT
All reviewed patches have been landed.  Closing bug.