A patch to constify gcc.c (Really, summarizing remaining warnings)
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sat Mar 13 08:28:00 GMT 1999
> From: Zack Weinberg <zack@rabi.columbia.edu>
>
> For the *_unlocked functions, what do you think of this patch (which I
> am testing as we speak)?
>
> 1999-03-11 12:23 -0500 Zack Weinberg <zack@rabi.phys.columbia.edu>
>
> * system.h: Use putc_unlocked, fputc_unlocked, and
> fputs_unlocked only if putc_unlocked has a prototype already.
> Prototype fputs_unlocked if necessary.
> * configure.in: Check for prototypes of putc_unlocked and
> fputs_unlocked.
> * acconfig.h: Updated.
I have a couple of questions...
> -#ifdef HAVE_FPUTC_UNLOCKED
> +#if defined HAVE_FPUTC_UNLOCKED && !defined NEED_DECLARATION_PUTC_UNLOCKED
> -#ifdef HAVE_FPUTS_UNLOCKED
> +#if defined HAVE_FPUTS_UNLOCKED && !defined NEED_DECLARATION_PUTC_UNLOCKED
I'm not sure why you checked for PUTC_UNLOCKED prototypes on
the above lines. Shouldn't they be checks for FPUTC and FPUTS to
match the function tested for?
> +# ifdef NEED_DECLARATION_FPUTS_UNLOCKED
> +extern int fputs_unlocked PROTO ((const char *, FILE *));
> #endif
Why did you decide here to prototype fputs_unlocked but none of
the others?
> GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
> index rindex getenv atol sbrk abort atof strerror getcwd getwd \
> - strsignal)
> + strsignal putc_unlocked fputs_unlocked)
In configure.in, why did you only check for two out of three of
the _unlocked functions? You were consistent with the macros system.h
you actually used, but I wasn't sure why you did this. Would you please
explain your approach?
Thanks,
--Kaveh
PS: Did it solve the warning problem?
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc-patches
mailing list