[gnome-bluetooth/wip/jtojnar/label] lib: Fix syntax error on clang and older gcc




commit 4b1b49bdc0d4afce92eb807222b446bcba6216a5
Author: Jan Tojnar <jtojnar gmail com>
Date:   Thu Feb 17 02:35:44 2022 +0000

    lib: Fix syntax error on clang and older gcc
    
    On gcc < 11 and any version of clang (tested up to 13),
    the build would fail with the following error:
    
        error: label at end of compound statement
    
    GCC 11+ seems to only complain with -Werror -Wpedantic,
    otherwise it tolerates even completely empty default: case.

 lib/bluetooth-utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/lib/bluetooth-utils.c b/lib/bluetooth-utils.c
index aafbbf08..4a208c58 100644
--- a/lib/bluetooth-utils.c
+++ b/lib/bluetooth-utils.c
@@ -94,10 +94,8 @@ bluetooth_type_to_string (BluetoothType type)
        case BLUETOOTH_TYPE_SPEAKERS:
                return _("Speakers");
        default:
-               /* fallthrough */
+               return _("Unknown");
        }
-
-       return _("Unknown");
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]