This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB 7.5 on Windows


On 08/18/2012 01:04 PM, Eli Zaretskii wrote:
> 1. Compilation in gdb/ produces gobs of warnings like this:
> 
>      In file included from defs.h:32,
> 		      from gdb.c:19:
>      d:/usr/include/stdio.h:372: warning: no previous prototype for 'getc'
>      d:/usr/include/stdio.h:379: warning: no previous prototype for 'putc'
>      d:/usr/include/stdio.h:386: warning: no previous prototype for 'getchar'
>      d:/usr/include/stdio.h:393: warning: no previous prototype for 'putchar'
>      d:/usr/include/stdio.h:535: warning: no previous prototype for 'fopen64'
>      d:/usr/include/stdio.h:547: warning: no previous prototype for 'ftello64'
>      d:/usr/include/stdio.h:606: warning: no previous prototype for 'vsnwprintf'
> 
>    This happens because these are inline functions in MinGW's stdio.h,
>    but their prototypes are only declared if the inline variants are
>    not used.  For example:
> 
>      #if !defined _MT
> 
>      __CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F)
>      {
>        return (--__F->_cnt >= 0)
> 	 ?  (int) (unsigned char) *__F->_ptr++
> 	 : _filbuf (__F);
>      }
>      [...]
>      #else  /* Use library functions.  */
> 
>      _CRTIMP int __cdecl __MINGW_NOTHROW	getc (FILE*);
> 
>    My suggestion would be to not use -Wmissing-prototypes when host is
>    mingw32.  (I worked around this by using --enable-gdb-build-warnings.)

This also makes me wonder if we shouldn't be building on mingw with -mthreads (which
would define _MT, IIRC), at least on your toolchain version.  GDB _is_ threaded on
Windows (for gdb_select).

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]