public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Arnaud Charlet <charlet@adacore.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix warning in adaint.c
Date: Fri, 15 Jan 2016 20:09:00 -0000	[thread overview]
Message-ID: <20160115200939.GA18406@adacore.com> (raw)
In-Reply-To: <20160115200436.GE3017@tucnak.redhat.com>

> I've noticed
> ../../gcc/ada/adaint.c: In function 'char*
> __gnat_locate_exec_on_path(char*)':
> ../../gcc/ada/adaint.c:2799:34: warning: deprecated conversion from
> string constant to 'char*' [-Wwrite-strings]
>    if (path_val == NULL) path_val = "";
>                                   ^
> warning, fixed thusly.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK, thanks.

> 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* adaint.c (__gnat_locate_exec_on_path): Use const char * instead
> 	of char * for path_val to avoid warnings.
> 
> --- gcc/ada/adaint.c.jj	2015-11-18 11:19:23.412735554 +0100
> +++ gcc/ada/adaint.c	2016-01-15 14:23:31.029079447 +0100
> @@ -2791,7 +2791,7 @@ __gnat_locate_exec_on_path (char *exec_n
>    WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE);
>  
>  #else
> -  char *path_val = getenv ("PATH");
> +  const char *path_val = getenv ("PATH");
>  
>    /* If PATH is not defined, proceed with __gnat_locate_exec anyway, so we
>    can
>       find files that contain directory names.  */
> 
> 	Jakub
> 

  reply	other threads:[~2016-01-15 20:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 20:04 Jakub Jelinek
2016-01-15 20:09 ` Arnaud Charlet [this message]
2016-01-17 17:51   ` [PATCH] Another warning fix " Jakub Jelinek
2016-01-17 17:56     ` Arnaud Charlet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160115200939.GA18406@adacore.com \
    --to=charlet@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).