diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 65911275d..99c187683 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -569,10 +569,10 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o switch (call->state){ case LinphoneCallResuming: linphone_core_notify_display_status(lc,_("Call resumed.")); - /*intentionally no break*/ + LINPHONE_NO_BREAK; /*intentionally no break*/ case LinphoneCallConnected: if (call->referer) linphone_core_notify_refer_state(lc,call->referer,call); - /*intentionally no break*/ + LINPHONE_NO_BREAK; /*intentionally no break*/ case LinphoneCallUpdating: case LinphoneCallUpdatedByRemote: if (!sal_media_description_has_dir(call->localdesc, SalStreamInactive) && @@ -741,7 +741,7 @@ static void call_updated(LinphoneCore *lc, LinphoneCall *call, SalOp *op, bool_t case LinphoneCallResuming: sal_error_info_set(&sei,SalReasonInternalError, "SIP", 0, NULL, NULL); sal_call_decline_with_error_info(call->op, &sei,NULL); - /*no break*/ + LINPHONE_NO_BREAK; /*no break*/ case LinphoneCallIdle: case LinphoneCallOutgoingInit: case LinphoneCallEnd: diff --git a/coreapi/friend.c b/coreapi/friend.c index ff47cabff..35382d41a 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -79,6 +79,7 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){ break; case LinphoneStatusVacation: str=_("Vacation"); + break; default: str=_("Unknown status"); } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index eeefc8577..67eabe457 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2540,6 +2540,7 @@ static void setZrtpCryptoTypesParameters(MSZrtpParams *params, LinphoneCore *lc) break; case MS_AES_CM_256_SHA1_80: ms_warning("Deprecated crypto suite MS_AES_CM_256_SHA1_80, use MS_AES_256_SHA1_80 instead"); + LINPHONE_NO_BREAK; case MS_AES_256_SHA1_80: params->ciphers[params->ciphersCount++] = MS_ZRTP_CIPHER_AES3; params->authTags[params->authTagsCount++] = MS_ZRTP_AUTHTAG_HS80; @@ -3797,6 +3798,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, LinphoneCallState nex if (linphone_core_get_remote_ringback_tone(lc)){ call->playing_ringbacktone = TRUE; } + LINPHONE_NO_BREAK; case LinphoneCallOutgoingEarlyMedia: if (!call->params->real_early_media){ call->all_muted = TRUE; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 395097823..67a237e11 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -460,12 +460,16 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) { case ORTP_TRACE: case ORTP_DEBUG: mask |= ORTP_DEBUG; + LINPHONE_NO_BREAK; case ORTP_MESSAGE: mask |= ORTP_MESSAGE; + LINPHONE_NO_BREAK; case ORTP_WARNING: mask |= ORTP_WARNING; + LINPHONE_NO_BREAK; case ORTP_ERROR: mask |= ORTP_ERROR; + LINPHONE_NO_BREAK; case ORTP_FATAL: mask |= ORTP_FATAL; break; diff --git a/gtk/main.c b/gtk/main.c index 85ec6d36d..b32b922c2 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1417,6 +1417,7 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call case LinphoneCallPausing: linphone_gtk_enable_hold_button(call,TRUE,FALSE); linphone_gtk_call_update_tab_header(call,FALSE); + LINPHONE_NO_BREAK; case LinphoneCallPausedByRemote: linphone_gtk_in_call_view_set_paused(call); linphone_gtk_call_update_tab_header(call,TRUE); diff --git a/include/linphone/defs.h b/include/linphone/defs.h index fc26222cb..825220122 100644 --- a/include/linphone/defs.h +++ b/include/linphone/defs.h @@ -48,5 +48,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_DEPRECATED MS2_DEPRECATED #endif +/* Macro telling GCC that a 'break' statement has been deliberately omitted + * in switch block */ +#ifndef LINPHONE_NO_BREAK +#ifdef __GNUC__ +#define LINPHONE_NO_BREAK __attribute__((fallthrough)) +#else +#define LINPHONE_NO_BREAK +#endif // __GNUC__ +#endif // LINPHONE_NO_BREAK + #endif /* LINPHONE_DEFS_H_ */