[Webkit-unassigned] [Bug 231880] [GTK][WPE] Support setting status code and getting HTTP method in custom URI scheme handlers
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 29 17:14:06 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=231880
--- Comment #30 from liushuyu011 at gmail.com ---
(In reply to Michael Catanzaro from comment #29)
> Comment on attachment 442655 [details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=442655&action=review
>
> >>> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:91
> >>> + gint64 streamLength;
> >>
> >> Move this to the case PROP_STREAM_LENGTH
> >
> > If I do this when compiling using Clang 12.0.1, the compiler will complain about (GCC does not report this one though):
> > (Line numbers are from the newer patch)
> >
> > ```
> > WebKitURISchemeResponse.cpp:83:13: warning: Cannot jump from switch statement to this case label clang(switch_into_protected_scope)
> > WebKitURISchemeResponse.cpp:78:16: note: Jump bypasses variable initialization
> > ```
> >
> > I am not sure if this is a false-positive from the compiler?
>
> Well that warning message seems clearly wrong, but perhaps you can silence
> it by adding braces?
>
> case PROP_STREAM_LENGTH: {
> // ...
> break;
> }
>
> This will limit the scope of the variable to only the 'case
> PROP_STREAM_LENGTH', which was the goal behind moving it anyway.
>
Thank you! The solves it. I am not sure why Clang is having issues with switch scoping in this case though.
> Good job iterating on all the feedback btw. The strict code style
> requirements keep things more maintainable.
Thank you! I think iterating the patch is a good way of learning how bigger projects write and maintain their code.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211030/0e3f3740/attachment-0001.htm>
More information about the webkit-unassigned
mailing list