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 05:00 PM, Joel Brobecker 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:
> 
> I do not get those warnings. In our case, I think that the C header
> files being used are the ones that come bundled with our compiler.
> I only have vague knowledge of how things fit together, but perhaps
> it's just a matter of which MinGW version you are using?

Sounds like it.  Maybe __CRT_INLINE expands to static inline for you, and
as extern inline for Eli.  You won't get the warning with a static function.

> 
>>    My suggestion would be to not use -Wmissing-prototypes when host is
>>    mingw32.  (I worked around this by using --enable-gdb-build-warnings.)
> 
> I'd rather avoid that, since the warnings are non-fatal in the release
> environment, and also because others do not have this warning.

One way to cope with both environments would be to add an autoconf check
that tries including stdio.h (and perhaps other system headers), and only
add -Wmissing-prototypes if that comes out clean.

-- 
Pedro Alves


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