[PATCH 2/2] fix compile errors for efgcvt.c

Kota Uchida uchan0+newlib@gmail.com
Wed Jul 24 08:43:00 GMT 2019


On Wed, Jul 24, 2019 at 4:25 PM Corinna Vinschen <vinschen@redhat.com> wrote:
> Why does your patch arbitrarily move the gcvt function?  There's
> no functional change, so this move should not be part of the patch.

The movement is the core of this patch.

When efgcvt.c is compiled under some specific conditions,
gcvt's function prototype is NOT provided by stdlib.h.
(Its prototype is gurded by macros)

If gcvt is below gcvtf, gcvt is implicitly declared as int
since gcvtf calls gcvt.
The implicit declaration is not compatible with its actual type.

So the possible options will be:
- To move gcvt above gcvtf, or
- To declare gcvt's prototype above gcvtf.

Should I choose 2nd option?



More information about the Newlib mailing list