Summary: | Code quality issue in weston? | ||
---|---|---|---|
Product: | Wayland | Reporter: | Rafael Castillo <jrch2k10> |
Component: | weston | Assignee: | Wayland bug list <wayland-bugs> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Rafael Castillo
2013-08-01 14:03:26 UTC
handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len) here is present too (In reply to comment #1) > handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len) > > here is present too What is the problem you see? Weston is the reference implementation, but that doesn't imply that lower standards or quality. While usage of 'goto' constantly receives a lot of negative press, it's usage in C code for error handling is generally considered cleaner than alternatives. In my personal opinion, I find it easier to read as well - rather than multiple levels of scope/indentation based on every potential error, you get a normal flow of code, where the (rare) errors cause the flow to break. If they require the same cleanup code, we sure don't want any duplication either. It's use should still be limited to specific applicable scenarios, but it's not a 'use a single goto and you'll cause a nuclear war' level style of issue. Hell, using a break in a switch statement is essentially a goto itself(!) Not enough information to resolve this issue. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.