This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH 1/2] doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Cc: newlib at sourceware dot org
- Date: Wed, 14 Jan 2015 16:24:16 -0500 (EST)
- Subject: Re: [PATCH 1/2] doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
- Authentication-results: sourceware.org; auth=none
- References: <1421261024-26955-1-git-send-email-joel dot sherrill at oarcorp dot com> <1308026416 dot 13919672 dot 1421270174930 dot JavaMail dot zimbra at redhat dot com> <54B6DD42 dot 4030607 at oarcorp dot com>
My e-mail reader tried to save it as an html file with tags in it. I had to
select and paste the text to a file. I would prefer to just download the patch
as it was meant to be and apply it. I also don't have to worry about lines being
folded, etc..
-- Jeff J.
----- Original Message -----
From: "Joel Sherrill" <joel.sherrill@oarcorp.com>
To: "Jeff Johnston" <jjohnstn@redhat.com>
Cc: newlib@sourceware.org
Sent: Wednesday, January 14, 2015 4:18:58 PM
Subject: Re: [PATCH 1/2] doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
On 1/14/2015 3:16 PM, Jeff Johnston wrote:
> Patch committed. Please use attachments for patches in the future.
OK. I just used git send-email for that. Did you have a problem? Normally
that works just great.
--joel
> -- Jeff J.
>
> ----- Original Message -----
> From: "Joel Sherrill" <joel.sherrill@oarcorp.com>
> To: newlib@sourceware.org
> Cc: "Joel Sherrill" <joel.sherrill@oarcorp.com>
> Sent: Wednesday, January 14, 2015 1:43:43 PM
> Subject: [PATCH 1/2] doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
>
> 2015-01-14 Joel Sherrill <joel.sherrill@oarcorp.com>
>
> * doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
> ---
> newlib/doc/makedoc.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c
> index 7d38a5d..7188642 100644
> --- a/newlib/doc/makedoc.c
> +++ b/newlib/doc/makedoc.c
> @@ -40,6 +40,7 @@ There is no
> #include <stdlib.h>
> #include <ctype.h>
> #include <string.h>
> +#include <stdint.h>
>
> #define DEF_SIZE 5000
> #define STACK 50
> @@ -219,10 +220,10 @@ typedef void (*stinst_type)(NOARGS);
> stinst_type *pc;
> stinst_type sstack[STACK];
> stinst_type *ssp = &sstack[0];
> -int istack[STACK];
> -int *isp = &istack[0];
> +uintptr_t istack[STACK];
> +uintptr_t *isp = &istack[0];
>
> -typedef int *word_type;
> +typedef uintptr_t *word_type;
>
>
>
> @@ -270,7 +271,7 @@ WORD(push_number)
> {
> isp++;
> pc++;
> - *isp = (int)(*pc);
> + *isp = (uintptr_t)(*pc);
> pc++;
>
> }
> @@ -1338,7 +1339,7 @@ return(ret);
>
> static void DEFUN_VOID(bang)
> {
> -*(int *)((isp[0])) = isp[-1];
> +*(uintptr_t *)((isp[0])) = isp[-1];
> isp-=2;
> pc++;
>
> @@ -1346,7 +1347,7 @@ pc++;
>
> WORD(atsign)
> {
> - isp[0] = *(int *)(isp[0]);
> + isp[0] = *(uintptr_t *)(isp[0]);
> pc++;
> }
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985