duplicate FILE typedef, stdio.h and wchar.h

Craig Howland howland@LGSInnovations.com
Thu Mar 5 17:17:00 GMT 2015


On 03/05/2015 07:19 AM, Corinna Vinschen wrote:
> On Mar  4 11:35, Craig Howland wrote:
>> On 03/04/2015 05:07 AM, Corinna Vinschen wrote:
>>
>>> I'm rather puzzled by this observation.  As you may imagine, these files
>>> are used for a long time in packages in the Cygwin distro, and if GCC
>>> would error out in this simple case, we had a lot of complaints from
>>> Cygwin package maintainers.  So the first question is, in which scenario
>>> do you see this problem?  I created an STC:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> #include <wchar.h>
>>> #include <stdio.h>
>>>
>>> extern FILE *foo (FILE *);
>>>
>>> int main ()
>>> {
>>>    FILE *fp = foo (NULL);
>>>    if (fp)
>>>      foo (fp);
>>>    return 0;
>>> }
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> and gcc -c -g -O2 -Wall does not error out, nor does it even produce
>>> a warning.  Same when reordering the includes.  Not even with -ansi.
>> I was quite surprised, too, but it's doing it (gcc 4.4.7 under RHEL6).  I
>> fiddled with options a little to no avail, but decided it was easier to just
>> fix it.
> Does the above testcase fail the same way with this gcc?  If not,
> it might be some different problem.  I wouldn't want to apply a
> fix which just covers another problem, if possible.
>
>
> Corinna
>
     Of primary importance, the duplicate typedefs are not permitted by the
C standard, even if they don't make a compiler error out.  I had not worked
through this before, but since you asked, indirectly, I checked it out.
C99 does not have one clean sentence I can quote, but if you work
through it, it is clear that typedefs are not permitted to be repeated.
(From 6.7, "If an identifier has no linkage, there shall be no more than
one declaration of the identifier (in a declarator or type specifier) with
the same scope and in the same name space, except for tags as specified
in 6.7.2.3."  And from 6.2.2, "The following identifiers have no linkage:
an identifier declared to be anything other than an object or a function;"
Well, typedefs are synonyms for types (see 6.7.7), and are neither tags
nor objects nor functions (c.f. 6.2.1), and therefore have no linkage
and therefore may not be declared more than once.)
      Despite that, to directly answer your question and to satisfy my
curiosity, I did several things.
      First, in a new location I did a brand-new cvs checkout.  I built and
got the same error that I have been (a sample):

gcc -I/tmp/test/bld/targ-include -I/tmp/test/src/newlib/libc/include 
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"2.2.0\" -DPACKAGE_STRING=\"newlib\ 2.2.0\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. 
-I../../../src/newlib/libc/stdlib -DMISSING_SYSCALL_NAMES -fno-builtin      -O2 
-c -o lib_a-efgcvt.o `test -f 'efgcvt.c' || echo 
'../../../src/newlib/libc/stdlib/'`efgcvt.c
In file included from ../../../src/newlib/libc/stdlib/local.h:11,
                  from ../../../src/newlib/libc/stdlib/efgcvt.c:138:
/tmp/test/src/newlib/libc/include/wchar.h:52: error: redefinition of typedef ‘FILE’
/tmp/test/src/newlib/libc/include/stdio.h:52: note: previous declaration of 
‘FILE’ was here
make[3]: *** [lib_a-efgcvt.o] Error 1

      Second, I had already done an even simpler test case than yours, which
I ran again under my fresh checkout.  This is using a copied and edited
compile command from the make which failed.

$ cat fail.c
#include <stdio.h>
#include <wchar.h>
$ gcc -I/tmp/test/bld/targ-include -I/tmp/test/src/newlib/libc/include 
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"2.2.0\" -DPACKAGE_STRING=\"newlib\ 2.2.0\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. 
-I../../../src/newlib/libc/stdlib -DMISSING_SYSCALL_NAMES -fno-builtin      -O2 
-c -o fail.o fail.c
In file included from fail.c:2:
/tmp/test/src/newlib/libc/include/wchar.h:52: error: redefinition of typedef ‘FILE’
/tmp/test/src/newlib/libc/include/stdio.h:52: note: previous declaration of 
‘FILE’ was here

      In case you'd like to see it, I have attached the output of the
preceding fail.c compile with the addition of -E.  As can be seen, it is
only the two identical typedefs (from stdio.h and wchar.h).

$ grep 'typedef.*FILE' fail.E
typedef struct __sFILE __FILE;
typedef __FILE FILE;
typedef __FILE FILE;

      Third, I tried editing the compile line a little, changing the first
two -I arguments into -isystem (which strictly speaking they probably should
be), and quite surprisingly it no longer fails, despite the preprocessed
output being identical for C statements (having differences in exactly
how the file names are labeled).  The preprocessed output from

gcc -E -isystem /tmp/test/bld/targ-include -isystem 
/tmp/test/src/newlib/libc/include -DPACKAGE_NAME=\"newlib\" 
-DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.2.0\" 
-DPACKAGE_STRING=\"newlib\ 2.2.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" 
-I. -I../../../src/newlib/libc/stdlib -DMISSING_SYSCALL_NAMES -fno-builtin      
-O2 -c -o fail.Esys fail.c

is also attached (fail.Esys).  Very strange.
      In summary, the patch to avoid the duplicate typedef should be applied
since the present case is in violation of the C standard, even if it can
in some cases get by the compiler.  I suppose a change should also be made
for gcc for the arguments to go from -I to -isystem (which really would
be proper from a GCC point of view), but that would probably be better
handled by someone who is more familiar with configure stuff than I am.
                 Craig


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fail.E
Type: text/x-eiffel
Size: 37807 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20150305/b95e48d2/attachment.bin>
-------------- next part --------------
# 1 "fail.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "fail.c"
# 1 "/tmp/test/src/newlib/libc/include/stdio.h" 1 3 4
# 29 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
# 1 "/tmp/test/src/newlib/libc/include/_ansi.h" 1 3 4
# 15 "/tmp/test/src/newlib/libc/include/_ansi.h" 3 4
# 1 "/tmp/test/bld/targ-include/newlib.h" 1 3 4
# 16 "/tmp/test/src/newlib/libc/include/_ansi.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/sys/config.h" 1 3 4



# 1 "/tmp/test/src/newlib/libc/include/machine/ieeefp.h" 1 3 4
# 5 "/tmp/test/src/newlib/libc/include/sys/config.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/sys/features.h" 1 3 4
# 6 "/tmp/test/src/newlib/libc/include/sys/config.h" 2 3 4
# 17 "/tmp/test/src/newlib/libc/include/_ansi.h" 2 3 4
# 30 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4





# 1 "/tmp/test/src/newlib/libc/include/sys/cdefs.h" 1 3 4
# 43 "/tmp/test/src/newlib/libc/include/sys/cdefs.h" 3 4
# 1 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 1 3 4
# 35 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef signed char __int8_t ;
typedef unsigned char __uint8_t ;
# 53 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef signed short __int16_t;
typedef unsigned short __uint16_t;
# 71 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
# 97 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef signed long __int64_t;
typedef unsigned long __uint64_t;
# 128 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
# 154 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
# 176 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
# 194 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
# 207 "/tmp/test/src/newlib/libc/include/machine/_default_types.h" 3 4
typedef long int __intptr_t;
typedef unsigned long int __uintptr_t;
# 44 "/tmp/test/src/newlib/libc/include/sys/cdefs.h" 2 3 4

# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 211 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 46 "/tmp/test/src/newlib/libc/include/sys/cdefs.h" 2 3 4
# 36 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 149 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 323 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 3 4
typedef int wchar_t;
# 37 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 40 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4







# 1 "/tmp/test/src/newlib/libc/include/sys/reent.h" 1 3 4
# 13 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
# 1 "/tmp/test/src/newlib/libc/include/_ansi.h" 1 3 4
# 14 "/tmp/test/src/newlib/libc/include/sys/reent.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 15 "/tmp/test/src/newlib/libc/include/sys/reent.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/sys/_types.h" 1 3 4
# 12 "/tmp/test/src/newlib/libc/include/sys/_types.h" 3 4
# 1 "/tmp/test/src/newlib/libc/include/machine/_types.h" 1 3 4
# 13 "/tmp/test/src/newlib/libc/include/sys/_types.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/sys/lock.h" 1 3 4





typedef int _LOCK_T;
typedef int _LOCK_RECURSIVE_T;
# 14 "/tmp/test/src/newlib/libc/include/sys/_types.h" 2 3 4


typedef long _off_t;



typedef short __dev_t;



typedef unsigned short __uid_t;


typedef unsigned short __gid_t;



__extension__ typedef long long _off64_t;







typedef long _fpos_t;
# 55 "/tmp/test/src/newlib/libc/include/sys/_types.h" 3 4
typedef long signed int _ssize_t;
# 67 "/tmp/test/src/newlib/libc/include/sys/_types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 352 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 68 "/tmp/test/src/newlib/libc/include/sys/_types.h" 2 3 4



typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    unsigned char __wchb[4];
  } __value;
} _mbstate_t;



typedef _LOCK_RECURSIVE_T _flock_t;




typedef void *_iconv_t;
# 16 "/tmp/test/src/newlib/libc/include/sys/reent.h" 2 3 4
# 25 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
typedef unsigned int __ULong;
# 38 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct _reent;






struct _Bigint
{
  struct _Bigint *_next;
  int _k, _maxwds, _sign, _wds;
  __ULong _x[1];
};


struct __tm
{
  int __tm_sec;
  int __tm_min;
  int __tm_hour;
  int __tm_mday;
  int __tm_mon;
  int __tm_year;
  int __tm_wday;
  int __tm_yday;
  int __tm_isdst;
};







struct _on_exit_args {
 void * _fnargs[32];
 void * _dso_handle[32];

 __ULong _fntypes;


 __ULong _is_cxa;
};
# 91 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct _atexit {
 struct _atexit *_next;
 int _ind;

 void (*_fns[32])(void);
        struct _on_exit_args _on_exit_args;
};
# 115 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct __sbuf {
 unsigned char *_base;
 int _size;
};
# 179 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct __sFILE {
  unsigned char *_p;
  int _r;
  int _w;
  short _flags;
  short _file;
  struct __sbuf _bf;
  int _lbfsize;






  void * _cookie;

  int (* _read) (struct _reent *, void *, char *, int)
                                          ;
  int (* _write) (struct _reent *, void *, const char *, int)

                                   ;
  _fpos_t (* _seek) (struct _reent *, void *, _fpos_t, int);
  int (* _close) (struct _reent *, void *);


  struct __sbuf _ub;
  unsigned char *_up;
  int _ur;


  unsigned char _ubuf[3];
  unsigned char _nbuf[1];


  struct __sbuf _lb;


  int _blksize;
  _off_t _offset;


  struct _reent *_data;



  _flock_t _lock;

  _mbstate_t _mbstate;
  int _flags2;
};
# 285 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
typedef struct __sFILE __FILE;



struct _glue
{
  struct _glue *_next;
  int _niobs;
  __FILE *_iobs;
};
# 317 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct _rand48 {
  unsigned short _seed[3];
  unsigned short _mult[3];
  unsigned short _add;




};
# 569 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
struct _reent
{
  int _errno;




  __FILE *_stdin, *_stdout, *_stderr;

  int _inc;
  char _emergency[25];

  int _current_category;
  const char *_current_locale;

  int __sdidinit;

  void (* __cleanup) (struct _reent *);


  struct _Bigint *_result;
  int _result_k;
  struct _Bigint *_p5s;
  struct _Bigint **_freelist;


  int _cvtlen;
  char *_cvtbuf;

  union
    {
      struct
        {
          unsigned int _unused_rand;
          char * _strtok_last;
          char _asctime_buf[26];
          struct __tm _localtime_buf;
          int _gamma_signgam;
          __extension__ unsigned long long _rand_next;
          struct _rand48 _r48;
          _mbstate_t _mblen_state;
          _mbstate_t _mbtowc_state;
          _mbstate_t _wctomb_state;
          char _l64a_buf[8];
          char _signal_buf[24];
          int _getdate_err;
          _mbstate_t _mbrlen_state;
          _mbstate_t _mbrtowc_state;
          _mbstate_t _mbsrtowcs_state;
          _mbstate_t _wcrtomb_state;
          _mbstate_t _wcsrtombs_state;
   int _h_errno;
        } _reent;



      struct
        {

          unsigned char * _nextf[30];
          unsigned int _nmalloc[30];
        } _unused;
    } _new;



  struct _atexit *_atexit;
  struct _atexit _atexit0;



  void (**(_sig_func))(int);




  struct _glue __sglue;
  __FILE __sf[3];
};
# 762 "/tmp/test/src/newlib/libc/include/sys/reent.h" 3 4
extern struct _reent *_impure_ptr ;
extern struct _reent *const _global_impure_ptr ;

void _reclaim_reent (struct _reent *);
# 48 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/sys/types.h" 1 3 4
# 69 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 70 "/tmp/test/src/newlib/libc/include/sys/types.h" 2 3 4
# 1 "/tmp/test/src/newlib/libc/include/machine/types.h" 1 3 4
# 19 "/tmp/test/src/newlib/libc/include/machine/types.h" 3 4
typedef long int __off_t;
typedef int __pid_t;

__extension__ typedef long long int __loff_t;
# 71 "/tmp/test/src/newlib/libc/include/sys/types.h" 2 3 4
# 93 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef unsigned char u_char;



typedef unsigned short u_short;



typedef unsigned int u_int;



typedef unsigned long u_long;





typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;



typedef unsigned long clock_t;




typedef long time_t;







struct timespec {
  time_t tv_sec;
  long tv_nsec;
};


struct itimerspec {
  struct timespec it_interval;
  struct timespec it_value;
};


typedef long daddr_t;



typedef char * caddr_t;
# 155 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef unsigned short ino_t;
# 184 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef _off_t off_t;
typedef __dev_t dev_t;
typedef __uid_t uid_t;
typedef __gid_t gid_t;





typedef int pid_t;







typedef long key_t;

typedef _ssize_t ssize_t;
# 217 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef unsigned int mode_t __attribute__ ((__mode__ (__SI__)));




typedef unsigned short nlink_t;
# 244 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef long fd_mask;







typedef struct _types_fd_set {
 fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))];
} _types_fd_set;
# 275 "/tmp/test/src/newlib/libc/include/sys/types.h" 3 4
typedef unsigned long clockid_t;




typedef unsigned long timer_t;



typedef unsigned long useconds_t;
typedef long suseconds_t;
# 49 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4



typedef __FILE FILE;




typedef _fpos_t fpos_t;





# 1 "/tmp/test/src/newlib/libc/include/sys/stdio.h" 1 3 4
# 64 "/tmp/test/src/newlib/libc/include/stdio.h" 2 3 4
# 164 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
FILE * tmpfile (void);
char * tmpnam (char *);

char * tempnam (const char *, const char *);

int fclose (FILE *);
int fflush (FILE *);
FILE * freopen (const char *, const char *, FILE *);
void setbuf (FILE *, char *);
int setvbuf (FILE *, char *, int, size_t);
int fprintf (FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int fscanf (FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
int printf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)))
                                                            ;
int scanf (const char *, ...) __attribute__ ((__format__ (__scanf__, 1, 2)))
                                                           ;
int sscanf (const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
int vfprintf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int vprintf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0)))
                                                            ;
int vsprintf (char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int fgetc (FILE *);
char * fgets (char *, int, FILE *);
int fputc (int, FILE *);
int fputs (const char *, FILE *);
int getc (FILE *);
int getchar (void);
char * gets (char *);
int putc (int, FILE *);
int putchar (int);
int puts (const char *);
int ungetc (int, FILE *);
size_t fread (void * , size_t _size, size_t _n, FILE *);
size_t fwrite (const void * , size_t _size, size_t _n, FILE *);



int fgetpos (FILE *, fpos_t *);

int fseek (FILE *, long, int);



int fsetpos (FILE *, const fpos_t *);

long ftell ( FILE *);
void rewind (FILE *);
void clearerr (FILE *);
int feof (FILE *);
int ferror (FILE *);
void perror (const char *);

FILE * fopen (const char * _name, const char * _type);
int sprintf (char *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int remove (const char *);
int rename (const char *, const char *);
# 235 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
int fseeko (FILE *, off_t, int);
off_t ftello ( FILE *);







int asiprintf (char **, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
char * asniprintf (char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
char * asnprintf (char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int asprintf (char **, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;

int diprintf (int, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;

int fiprintf (FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int fiscanf (FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
int iprintf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)))
                                                            ;
int iscanf (const char *, ...) __attribute__ ((__format__ (__scanf__, 1, 2)))
                                                           ;
int siprintf (char *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int siscanf (const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
int snprintf (char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int sniprintf (char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int vasiprintf (char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
char * vasniprintf (char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
char * vasnprintf (char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int vasprintf (char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int vdiprintf (int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int vfiprintf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int vfiscanf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
int vfscanf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
int viprintf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0)))
                                                            ;
int viscanf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 1, 0)))
                                                           ;
int vscanf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 1, 0)))
                                                           ;
int vsiprintf (char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int vsiscanf (const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
int vsniprintf (char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int vsnprintf (char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int vsscanf (const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
# 313 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
FILE * fdopen (int, const char *);

int fileno (FILE *);
int getw (FILE *);
int pclose (FILE *);
FILE * popen (const char *, const char *);
int putw (int, FILE *);
void setbuffer (FILE *, char *, int);
int setlinebuf (FILE *);
int getc_unlocked (FILE *);
int getchar_unlocked (void);
void flockfile (FILE *);
int ftrylockfile (FILE *);
void funlockfile (FILE *);
int putc_unlocked (int, FILE *);
int putchar_unlocked (int);
# 338 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
int dprintf (int, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;

FILE * fmemopen (void *, size_t, const char *);


FILE * open_memstream (char **, size_t *);

int renameat (int, const char *, int, const char *);

int vdprintf (int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;







int _asiprintf_r (struct _reent *, char **, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
                                                            ;
char * _asnprintf_r (struct _reent *, char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
                                                            ;
int _asprintf_r (struct _reent *, char **, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _diprintf_r (struct _reent *, int, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _dprintf_r (struct _reent *, int, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _fclose_r (struct _reent *, FILE *);
int _fcloseall_r (struct _reent *);
FILE * _fdopen_r (struct _reent *, int, const char *);
int _fflush_r (struct _reent *, FILE *);
int _fgetc_r (struct _reent *, FILE *);
int _fgetc_unlocked_r (struct _reent *, FILE *);
char * _fgets_r (struct _reent *, char *, int, FILE *);
char * _fgets_unlocked_r (struct _reent *, char *, int, FILE *);




int _fgetpos_r (struct _reent *, FILE *, fpos_t *);
int _fsetpos_r (struct _reent *, FILE *, const fpos_t *);

int _fiprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _fiscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
                                                           ;
FILE * _fmemopen_r (struct _reent *, void *, size_t, const char *);
FILE * _fopen_r (struct _reent *, const char *, const char *);
FILE * _freopen_r (struct _reent *, const char *, const char *, FILE *);
int _fprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _fpurge_r (struct _reent *, FILE *);
int _fputc_r (struct _reent *, int, FILE *);
int _fputc_unlocked_r (struct _reent *, int, FILE *);
int _fputs_r (struct _reent *, const char *, FILE *);
int _fputs_unlocked_r (struct _reent *, const char *, FILE *);
size_t _fread_r (struct _reent *, void * , size_t _size, size_t _n, FILE *);
size_t _fread_unlocked_r (struct _reent *, void * , size_t _size, size_t _n, FILE *);
int _fscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
                                                           ;
int _fseek_r (struct _reent *, FILE *, long, int);
int _fseeko_r (struct _reent *, FILE *, _off_t, int);
long _ftell_r (struct _reent *, FILE *);
_off_t _ftello_r (struct _reent *, FILE *);
void _rewind_r (struct _reent *, FILE *);
size_t _fwrite_r (struct _reent *, const void * , size_t _size, size_t _n, FILE *);
size_t _fwrite_unlocked_r (struct _reent *, const void * , size_t _size, size_t _n, FILE *);
int _getc_r (struct _reent *, FILE *);
int _getc_unlocked_r (struct _reent *, FILE *);
int _getchar_r (struct _reent *);
int _getchar_unlocked_r (struct _reent *);
char * _gets_r (struct _reent *, char *);
int _iprintf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int _iscanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
FILE * _open_memstream_r (struct _reent *, char **, size_t *);
void _perror_r (struct _reent *, const char *);
int _printf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
                                                            ;
int _putc_r (struct _reent *, int, FILE *);
int _putc_unlocked_r (struct _reent *, int, FILE *);
int _putchar_unlocked_r (struct _reent *, int);
int _putchar_r (struct _reent *, int);
int _puts_r (struct _reent *, const char *);
int _remove_r (struct _reent *, const char *);
int _rename_r (struct _reent *, const char *_old, const char *_new)
                                          ;
int _scanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
                                                           ;
int _siprintf_r (struct _reent *, char *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _siscanf_r (struct _reent *, const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
                                                           ;
int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
                                                            ;
int _snprintf_r (struct _reent *, char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
                                                            ;
int _sprintf_r (struct _reent *, char *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
                                                            ;
int _sscanf_r (struct _reent *, const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
                                                           ;
char * _tempnam_r (struct _reent *, const char *, const char *);
FILE * _tmpfile_r (struct _reent *);
char * _tmpnam_r (struct _reent *, char *);
int _ungetc_r (struct _reent *, int, FILE *);
int _vasiprintf_r (struct _reent *, char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
                                                            ;
char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
                                                            ;
int _vasprintf_r (struct _reent *, char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vdiprintf_r (struct _reent *, int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vdprintf_r (struct _reent *, int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vfiprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vfiscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
                                                           ;
int _vfprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vfscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
                                                           ;
int _viprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int _viscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
int _vprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
                                                            ;
int _vscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
                                                           ;
int _vsiprintf_r (struct _reent *, char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vsiscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
                                                           ;
int _vsniprintf_r (struct _reent *, char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
                                                            ;
int _vsnprintf_r (struct _reent *, char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
                                                            ;
int _vsprintf_r (struct _reent *, char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
                                                            ;
int _vsscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
                                                           ;



int fpurge (FILE *);
ssize_t __getdelim (char **, size_t *, int, FILE *);
ssize_t __getline (char **, size_t *, FILE *);


void clearerr_unlocked (FILE *);
int feof_unlocked (FILE *);
int ferror_unlocked (FILE *);
int fileno_unlocked (FILE *);
int fflush_unlocked (FILE *);
int fgetc_unlocked (FILE *);
int fputc_unlocked (int, FILE *);
size_t fread_unlocked (void * , size_t _size, size_t _n, FILE *);
size_t fwrite_unlocked (const void * , size_t _size, size_t _n, FILE *);
# 538 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
int __srget_r (struct _reent *, FILE *);
int __swbuf_r (struct _reent *, int, FILE *);
# 562 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4
FILE *funopen (const void * __cookie, int (*__readfn)(void * __cookie, char *__buf, int __n), int (*__writefn)(void * __cookie, const char *__buf, int __n), fpos_t (*__seekfn)(void * __cookie, fpos_t __off, int __whence), int (*__closefn)(void * __cookie))





                                   ;
FILE *_funopen_r (struct _reent *, const void * __cookie, int (*__readfn)(void * __cookie, char *__buf, int __n), int (*__writefn)(void * __cookie, const char *__buf, int __n), fpos_t (*__seekfn)(void * __cookie, fpos_t __off, int __whence), int (*__closefn)(void * __cookie))





                                   ;







typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n);
typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf,
     size_t __n);




typedef int cookie_seek_function_t(void *__cookie, off_t *__off, int __whence);

typedef int cookie_close_function_t(void *__cookie);
typedef struct
{


  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie (void *__cookie, const char *__mode, cookie_io_functions_t __functions)
                                                         ;
FILE *_fopencookie_r (struct _reent *, void *__cookie, const char *__mode, cookie_io_functions_t __functions)
                                                         ;
# 725 "/tmp/test/src/newlib/libc/include/stdio.h" 3 4

# 2 "fail.c" 2
# 1 "/tmp/test/src/newlib/libc/include/wchar.h" 1 3 4
# 12 "/tmp/test/src/newlib/libc/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h" 1 3 4
# 13 "/tmp/test/src/newlib/libc/include/wchar.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h" 1 3 4
# 16 "/tmp/test/src/newlib/libc/include/wchar.h" 2 3 4
# 49 "/tmp/test/src/newlib/libc/include/wchar.h" 3 4



typedef __FILE FILE;



struct tm;



typedef _mbstate_t mbstate_t;


wint_t btowc (int);
int wctob (wint_t);
size_t mbrlen (const char *, size_t, mbstate_t *);
size_t mbrtowc (wchar_t *, const char *, size_t, mbstate_t *)
                             ;
size_t _mbrtowc_r (struct _reent *, wchar_t * , const char * , size_t, mbstate_t *)
                        ;
int mbsinit (const mbstate_t *);
size_t mbsnrtowcs (wchar_t *, const char **, size_t, size_t, mbstate_t *)
                                           ;
size_t _mbsnrtowcs_r (struct _reent *, wchar_t * , const char ** , size_t, size_t, mbstate_t *)
                                ;
size_t mbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *)
                           ;
size_t _mbsrtowcs_r (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *);
size_t wcrtomb (char *, wchar_t, mbstate_t *);
size_t _wcrtomb_r (struct _reent *, char * , wchar_t, mbstate_t *);
size_t wcsnrtombs (char *, const wchar_t **, size_t, size_t, mbstate_t *)
                                           ;
size_t _wcsnrtombs_r (struct _reent *, char * , const wchar_t ** , size_t, size_t, mbstate_t *)
                                ;
size_t wcsrtombs (char *, const wchar_t **, size_t, mbstate_t *)
                                   ;
size_t _wcsrtombs_r (struct _reent *, char * , const wchar_t ** , size_t, mbstate_t *)
                        ;
int wcscasecmp (const wchar_t *, const wchar_t *);
wchar_t *wcscat (wchar_t *, const wchar_t *);
wchar_t *wcschr (const wchar_t *, wchar_t);
int wcscmp (const wchar_t *, const wchar_t *);
int wcscoll (const wchar_t *, const wchar_t *);
wchar_t *wcscpy (wchar_t *, const wchar_t *);
wchar_t *wcpcpy (wchar_t *, const wchar_t *)
                                ;
wchar_t *wcsdup (const wchar_t *);
wchar_t *_wcsdup_r (struct _reent *, const wchar_t * );
size_t wcscspn (const wchar_t *, const wchar_t *);
size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *)
                                                            ;
size_t wcslcat (wchar_t *, const wchar_t *, size_t);
size_t wcslcpy (wchar_t *, const wchar_t *, size_t);
size_t wcslen (const wchar_t *);
int wcsncasecmp (const wchar_t *, const wchar_t *, size_t);
wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t)
                                        ;
int wcsncmp (const wchar_t *, const wchar_t *, size_t);
wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t)
                                        ;
wchar_t *wcpncpy (wchar_t *, const wchar_t *, size_t)
                                        ;
size_t wcsnlen (const wchar_t *, size_t);
wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
wchar_t *wcsrchr (const wchar_t *, wchar_t);
size_t wcsspn (const wchar_t *, const wchar_t *);
wchar_t *wcsstr (const wchar_t *, const wchar_t *)
                                ;
wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **)
                           ;
double wcstod (const wchar_t *, wchar_t **);
double _wcstod_r (struct _reent *, const wchar_t *, wchar_t **);
float wcstof (const wchar_t *, wchar_t **);
float _wcstof_r (struct _reent *, const wchar_t *, wchar_t **);
int wcswidth (const wchar_t *, size_t);
size_t wcsxfrm (wchar_t *, const wchar_t *, size_t)
            ;
int wcwidth (const wchar_t);
wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
int wmemcmp (const wchar_t *, const wchar_t *, size_t);
wchar_t *wmemcpy (wchar_t *, const wchar_t *, size_t)
             ;
wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
wchar_t *wmemset (wchar_t *, wchar_t, size_t);

long wcstol (const wchar_t *, wchar_t **, int);
long long wcstoll (const wchar_t *, wchar_t **, int)
           ;
unsigned long wcstoul (const wchar_t *, wchar_t **, int)
            ;
unsigned long long wcstoull (const wchar_t *, wchar_t **, int)
                                    ;
long _wcstol_r (struct _reent *, const wchar_t *, wchar_t **, int);
long long _wcstoll_r (struct _reent *, const wchar_t *, wchar_t **, int);
unsigned long _wcstoul_r (struct _reent *, const wchar_t *, wchar_t **, int);
unsigned long long _wcstoull_r (struct _reent *, const wchar_t *, wchar_t **, int);
long double wcstold (const wchar_t *, wchar_t **);

wint_t fgetwc (__FILE *);
wchar_t *fgetws (wchar_t *, int, __FILE *);
wint_t fputwc (wchar_t, __FILE *);
int fputws (const wchar_t *, __FILE *);
int fwide (__FILE *, int);
wint_t getwc (__FILE *);
wint_t getwchar (void);
wint_t putwc (wchar_t, __FILE *);
wint_t putwchar (wchar_t);
wint_t ungetwc (wint_t wc, __FILE *);

wint_t _fgetwc_r (struct _reent *, __FILE *);
wint_t _fgetwc_unlocked_r (struct _reent *, __FILE *);
wchar_t *_fgetws_r (struct _reent *, wchar_t *, int, __FILE *);
wchar_t *_fgetws_unlocked_r (struct _reent *, wchar_t *, int, __FILE *);
wint_t _fputwc_r (struct _reent *, wchar_t, __FILE *);
wint_t _fputwc_unlocked_r (struct _reent *, wchar_t, __FILE *);
int _fputws_r (struct _reent *, const wchar_t *, __FILE *);
int _fputws_unlocked_r (struct _reent *, const wchar_t *, __FILE *);
int _fwide_r (struct _reent *, __FILE *, int);
wint_t _getwc_r (struct _reent *, __FILE *);
wint_t _getwc_unlocked_r (struct _reent *, __FILE *);
wint_t _getwchar_r (struct _reent *ptr);
wint_t _getwchar_unlocked_r (struct _reent *ptr);
wint_t _putwc_r (struct _reent *, wchar_t, __FILE *);
wint_t _putwc_unlocked_r (struct _reent *, wchar_t, __FILE *);
wint_t _putwchar_r (struct _reent *, wchar_t);
wint_t _putwchar_unlocked_r (struct _reent *, wchar_t);
wint_t _ungetwc_r (struct _reent *, wint_t wc, __FILE *);
# 189 "/tmp/test/src/newlib/libc/include/wchar.h" 3 4
__FILE *open_wmemstream (wchar_t **, size_t *);
__FILE *_open_wmemstream_r (struct _reent *, wchar_t **, size_t *);
# 200 "/tmp/test/src/newlib/libc/include/wchar.h" 3 4
int fwprintf (__FILE *, const wchar_t *, ...);
int swprintf (wchar_t *, size_t, const wchar_t *, ...)
                                   ;
int vfwprintf (__FILE *, const wchar_t *, __gnuc_va_list)
             ;
int vswprintf (wchar_t *, size_t, const wchar_t *, __gnuc_va_list)
                                        ;
int vwprintf (const wchar_t *, __gnuc_va_list);
int wprintf (const wchar_t *, ...);

int _fwprintf_r (struct _reent *, __FILE *, const wchar_t *, ...);
int _swprintf_r (struct _reent *, wchar_t *, size_t, const wchar_t *, ...);
int _vfwprintf_r (struct _reent *, __FILE *, const wchar_t *, __gnuc_va_list);
int _vswprintf_r (struct _reent *, wchar_t *, size_t, const wchar_t *, __gnuc_va_list);
int _vwprintf_r (struct _reent *, const wchar_t *, __gnuc_va_list);
int _wprintf_r (struct _reent *, const wchar_t *, ...);

int fwscanf (__FILE *, const wchar_t *, ...);
int swscanf (const wchar_t *, const wchar_t *, ...)
                                   ;
int vfwscanf (__FILE *, const wchar_t *, __gnuc_va_list)
             ;
int vswscanf (const wchar_t *, const wchar_t *, __gnuc_va_list)
             ;
int vwscanf (const wchar_t *, __gnuc_va_list);
int wscanf (const wchar_t *, ...);

int _fwscanf_r (struct _reent *, __FILE *, const wchar_t *, ...);
int _swscanf_r (struct _reent *, const wchar_t *, const wchar_t *, ...);
int _vfwscanf_r (struct _reent *, __FILE *, const wchar_t *, __gnuc_va_list);
int _vswscanf_r (struct _reent *, const wchar_t *, const wchar_t *, __gnuc_va_list);
int _vwscanf_r (struct _reent *, const wchar_t *, __gnuc_va_list);
int _wscanf_r (struct _reent *, const wchar_t *, ...);
# 246 "/tmp/test/src/newlib/libc/include/wchar.h" 3 4

# 2 "fail.c" 2


More information about the Newlib mailing list