[PATCH wayland] scanner: Reword fallthrough comment to quiet GCC

Yong Bakos junk at humanoriented.com
Fri Mar 17 17:55:08 UTC 2017


Hi Daniel,

> On Mar 17, 2017, at 10:36 AM, Daniel Stone <daniels at collabora.com> wrote:
> 
> GCC 7 now requires an explicit comment noting that case statements
> without a break fall through. We already had one of those in the
> scanner, but GCC wasn't smart enough to pick it up.
> 
> Quiet the warning by making the comment less elaborate.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>

This mere comment change seems innocuous enough.
(Should the standard `__attribute__ ((fallthrough))` be used instead?)

Reviewed-by: Yong Bakos <ybakos at humanoriented.com>

yong


> ---
> src/scanner.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/scanner.c b/src/scanner.c
> index a6c334fb..517068c4 100644
> --- a/src/scanner.c
> +++ b/src/scanner.c
> @@ -740,9 +740,7 @@ start_element(void *data, const char *element_name, const char **atts)
> 		switch (arg->type) {
> 		case NEW_ID:
> 			ctx->message->new_id_count++;
> -
> -			/* Fall through to OBJECT case. */
> -
> +			/* fallthrough */
> 		case OBJECT:
> 			if (interface_name)
> 				arg->interface_name = xstrdup(interface_name);
> -- 
> 2.12.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list