]> sourceware.org Git - newlib-cygwin.git/commitdiff
libc: fix fropen/fwopen compile warnings
authorAlexey Lapshin <alexey.lapshin@espressif.com>
Wed, 7 Dec 2022 10:59:23 +0000 (10:59 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 7 Dec 2022 12:10:24 +0000 (13:10 +0100)
This patch fixes warnings that appears when compiling:

#define fwopen(__cookie,__fn) funopen(__cookie, (int (*)())0, __fn,
(fpos_t (*)())0, (int (*)())0)
Expands to:

funopen(__null, (int (*)())0, &app_printf, (fpos_t (*)())0, (int
(*)())0)
argument of type "int (*)()" is incompatible with parameter of type
"int (*)(void *__cookie, char *__buf, int __n)"C/C++(167)
invalid conversion from 'fpos_t (*)()' {aka 'long int (*)()'} to
'fpos_t (*)(void*, fpos_t, int)' {aka 'long int (*)(void*,

Discussion is here:
https://github.com/espressif/arduino-esp32/issues/7407

newlib/libc/include/stdio.h

index ea4ddf3293d0793670ec61358d5d09f1ab2b7682..77966578d802e11ff2b4746a23566c55bb18e861 100644 (file)
@@ -620,10 +620,8 @@ FILE       *_funopen_r (struct _reent *, const void *__cookie,
                int (*__closefn)(void *__cookie));
 # endif /* !__LARGE64_FILES */
 
-# define       fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \
-                                              (fpos_t (*)())0, (int (*)())0)
-# define       fwopen(__cookie, __fn) funopen(__cookie, (int (*)())0, __fn, \
-                                              (fpos_t (*)())0, (int (*)())0)
+# define       fropen(__cookie, __fn) funopen(__cookie, __fn, NULL, NULL, NULL)
+# define       fwopen(__cookie, __fn) funopen(__cookie, NULL, __fn, NULL, NULL)
 #endif /* __BSD_VISIBLE */
 
 #if __GNU_VISIBLE
This page took 0.031352 seconds and 5 git commands to generate.