I have already made changes regarding this;  I believe my change is more
correct.  I switched from ...

    const char **const language

... to ...

    char **const language

... and removed the casting to (void *) of *language in the free, and
there are no errors or warnings in clang 3.5.0 or gcc 4.8.4.

As this function never changes the value of language (the pointer to a
pointer), only changing *language (the dereferenced pointer), I think
this is the correct declaration.

Unfortunately, I don't have GCC 5.1 available to try and reproduce the
warning Peter was getting.

Unless someone convinces me otherwise (or overrules me), I do not intend
to apply patch 6.

Henry

On Thursday, 06 August 2015 at 10:20:39 am +0200, Élie Roux wrote:
> Another patch from/for TeXLive!
> 
> 
> Thank you,
> --
> Elie
> 
> -------- Message transféré --------
> Sujet : Re: [tex-live] Gregorio integration
> Date : Thu, 6 Aug 2015 08:21:31 +0200 (CEST)
> De : Peter Breitenlohner <[email protected]>
> Pour : Élie Roux <[email protected]>
> Copie à : Karl Berry <[email protected]>
> 
> On Tue, 4 Aug 2015, Élie Roux wrote:
> 
> >> vowel/vowel-rules.y lines 83, 88, and 90: if language, name, and
> >> target are really const then it is suspicious or worse to free then,
> >> if not they should be declared differently.
> >
> > I'll take a look at that!
> 
> Hi Élie,
> 
> the attached small patch avoids two of these warnings.
> 
> Regards
> Peter
> 
> 

> diff -ur gregorio-4.0.0-beta.orig/src/vowel/vowel-rules-y.c 
> gregorio-4.0.0-beta/src/vowel/vowel-rules-y.c
> --- gregorio-4.0.0-beta.orig/src/vowel/vowel-rules-y.c        2015-08-01 
> 15:53:42.000000000 +0200
> +++ gregorio-4.0.0-beta/src/vowel/vowel-rules-y.c     2015-08-05 
> 13:38:18.000000000 +0200
> @@ -145,9 +145,9 @@
>      return false;
>  }
>  
> -static inline void alias(const char **const language,
> -        rulefile_parse_status *const status, const char *const name,
> -        const char *const target)
> +static inline void alias(const char **language,
> +        rulefile_parse_status *const status, char *name,
> +        char *target)
>  {
>      if (strcmp(*language, name) == 0) {
>          gregorio_messagef("alias", VERBOSITY_INFO, 0, _("Aliasing %s to %s"),
> diff -ur gregorio-4.0.0-beta.orig/src/vowel/vowel-rules-y.h 
> gregorio-4.0.0-beta/src/vowel/vowel-rules-y.h
> --- gregorio-4.0.0-beta.orig/src/vowel/vowel-rules-y.h        2015-08-01 
> 15:53:42.000000000 +0200
> +++ gregorio-4.0.0-beta/src/vowel/vowel-rules-y.h     2015-08-05 
> 13:51:01.000000000 +0200
> @@ -1,5 +1,5 @@
>  /* A Bison parser, made by GNU Bison 3.0.4.  */
> -
> +/* Make sure this file is newer than vowel-rules.y */
>  /* Bison interface for Yacc-like parsers in C
>  
>     Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
> diff -ur gregorio-4.0.0-beta.orig/src/vowel/vowel-rules.y 
> gregorio-4.0.0-beta/src/vowel/vowel-rules.y
> --- gregorio-4.0.0-beta.orig/src/vowel/vowel-rules.y  2015-07-05 
> 21:16:32.000000000 +0200
> +++ gregorio-4.0.0-beta/src/vowel/vowel-rules.y       2015-08-05 
> 13:44:33.000000000 +0200
> @@ -72,9 +72,9 @@
>      return false;
>  }
>  
> -static inline void alias(const char **const language,
> -        rulefile_parse_status *const status, const char *const name,
> -        const char *const target)
> +static inline void alias(const char **language,
> +        rulefile_parse_status *const status, char *name,
> +        char *target)
>  {
>      if (strcmp(*language, name) == 0) {
>          gregorio_messagef("alias", VERBOSITY_INFO, 0, _("Aliasing %s to %s"),

> _______________________________________________
> Gregorio-devel mailing list
> [email protected]
> https://mail.gna.org/listinfo/gregorio-devel


_______________________________________________
Gregorio-devel mailing list
[email protected]
https://mail.gna.org/listinfo/gregorio-devel

Répondre à