[vlc-devel] [PATCH] config: display unknown options

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 21 13:43:13 CEST 2020


On 2020-09-21 12:53, Alexandre Janniaux wrote:
> When an unknown option is requested, the assertion triggers on the null
> configuration variable, but the name of the missing variable is not
> displayed.
> 
> While it's (sometimes) possible to display it through debugger or
> additional code, the assertion is very usual and the message is
> especially useful when debugging mobile devices or using libvlc without
> being a core developer.
> ---
>   src/config/core.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/config/core.c b/src/config/core.c
> index ce05d20afd..48be3f39c2 100644
> --- a/src/config/core.c
> +++ b/src/config/core.c
> @@ -116,6 +116,11 @@ char *config_GetPsz(const char *psz_name)
>   
>       p_config = config_FindConfig( psz_name );
>   
> +#ifndef NDEBUG
> +    if (p_config == NULL)
> +        fprintf(stderr, "Unknown vlc configuration variable named %s\n", psz_name);

I don't think fprintf belongs in the core. But since it's for debug 
builds, why not.

> +#endif
> +
>       /* sanity checks */
>       assert(p_config != NULL);
>       assert(IsConfigStringType (p_config->i_type));
> -- 
> 2.28.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list