From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24512 invoked by alias); 18 Feb 2015 16:51:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24498 invoked by uid 89); 18 Feb 2015 16:51:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 18 Feb 2015 16:51:19 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 2F8443406AD; Wed, 18 Feb 2015 16:51:17 +0000 (UTC) Date: Wed, 18 Feb 2015 16:51:00 -0000 From: Mike Frysinger To: Jiri Gaisler Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 13/23] sim/erc32: Fix a few compiler warnings Message-ID: <20150218165117.GS544@vapier> Mail-Followup-To: Jiri Gaisler , gdb-patches@sourceware.org References: <1424159099-5148-1-git-send-email-jiri@gaisler.se> <1424159099-5148-14-git-send-email-jiri@gaisler.se> <20150217110759.GH544@vapier> <54E4BBFF.1030307@gaisler.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="psiTe9LjpVyD9953" Content-Disposition: inline In-Reply-To: <54E4BBFF.1030307@gaisler.se> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00486.txt.bz2 --psiTe9LjpVyD9953 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1306 On 18 Feb 2015 17:21, Jiri Gaisler wrote: > On 02/17/2015 12:07 PM, Mike Frysinger wrote: > > On 17 Feb 2015 08:44, Jiri Gaisler wrote: > >> Minor edits to remove compiler warnings. > >=20 > > if you're really interested in doing this, you could add SIM_AC_OPTION_= WARNINGS=20 > > to the erc32/configure.ac script ... > >=20 > >> --- a/sim/erc32/interf.c > >> +++ b/sim/erc32/interf.c > >> @@ -509,7 +509,7 @@ sim_do_command(sd, cmd) > >> SIM_DESC sd; > >> const char *cmd; > >> { > >> - exec_cmd(&sregs, cmd); > >> + exec_cmd(&sregs, (char *) cmd); > >> } > >=20 > > shouldn't exec_cmd be changed to take a const char * instead ? looks t= o me like=20 > > it treats it as constant ... it does a strdup(cmd) and only operates on= the=20 > > result. >=20 > I am passing cmd to strok() at one place, so const char cannot be used. ah, i see that now yes. i'm not sure deploying the cast is correct as the = API=20 allows for a constant to be passed in at which time this would crash. > > looking further, seems like it this func really should use buildargv/fr= eeargv=20 > > rather than tokenize things itself ? >=20 > I will keep this on my soon-todo list. Please bare with it this time ... np. in the meantime, adding a second dupe should allow for minimal code ch= ange. -mike --psiTe9LjpVyD9953 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU5MMFAAoJEEFjO5/oN/WBfIwP/R6yUxQXRU3+qO/+bLpobxhL jvIIU1eIGy/XoJBPAtykjNB63JU6dwziqDcBI0/kS/+Cc95Vll4LE3UBopicTI5H dG05htgf127hqVyvEit5iIxa8P1AOVgTwRN2XFtX6sDlIS0r05yBANGEgdHXuJRx XZCBkLTkVad5qv+dVnR+ie7OSW+umZv+5u+5pO+TXoQ7uld4jXxSh2NLEaHuJ1j1 aGTn5Su9yw0gSt0KHZAzQ1+lxWIj11kYYmjhI09hMK7CuqhxTjoYzHM7BgBjuq1n v/pisIXyOPHmmL8UEKFlbzSa8tvDYYIolLT/Nnyix4HYu409cGTZ8ZaWmDAWCY/c +WF8BzkkQhizIm92U7fQ5eyEDjChbY/11m2lwiB02bsNkJsdEXLerOKubcePAfTJ 8ouOhEtoiC2qP+N4Z7bxNyxb7e/umVcsbfUjyQ6vQD60oM0liIL8vlbQtwGmVcAC zgLAIqfpephqH9u2LIWS8FdmgqOgNyXRBzqn2dGUgwyysczV6s/lCdmG2JKNqM9p TTNcoIVMSe75I/A4s0ucPYvZUiIn7kaS83t/Y9EgLQ/gxIhX71fSJTfWv69grPjM mqi/XPpuVcWfFOTi84/H5MPshAy3R45SCEd17CGeueFtt04nYKBjlXaPF6YB6S6Y ZQC5Pxg6mjCdOMc3mZZ/ =RWaG -----END PGP SIGNATURE----- --psiTe9LjpVyD9953--