public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [mingw]gdb CVS HEAD build error
@ 2012-05-14  1:24 asmwarrior
  2012-05-14  2:49 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: asmwarrior @ 2012-05-14  1:24 UTC (permalink / raw)
  To: gdb

I have build error when building gdbserver.exe
Here is the log:
mingw32-gcc -c  -g -O2 -D__USE_MINGW_ACCESS    -I. -I../../../gdb/gdb/gdbserver -I../../../gdb/gdb/gdbserver/../common -I../../../gdb/gdb/gdbserver/../regformats -I../../../gdb/gdb/gdbserver/../../include -I../../../gdb/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../gdb/gdb/gdbserver/../common/buffer.c -DGDBSERVER
../../../gdb/gdb/gdbserver/../common/buffer.c: In function 'buffer_xml_printf':
../../../gdb/gdb/gdbserver/../common/buffer.c:144:9: error: unknown conversion type character 'l' in format [-Werror=format]
../../../gdb/gdb/gdbserver/../common/buffer.c:144:9: error: too many arguments for format [-Werror=format-extra-args]
../../../gdb/gdb/gdbserver/../common/buffer.c:147:9: error: unknown conversion type character 'l' in format [-Werror=format]
../../../gdb/gdb/gdbserver/../common/buffer.c:147:9: error: too many arguments for format [-Werror=format-extra-args]
../../../gdb/gdb/gdbserver/../common/buffer.c:150:9: error: unknown conversion type character 'l' in format [-Werror=format]
../../../gdb/gdb/gdbserver/../common/buffer.c:150:9: error: too many arguments for format [-Werror=format-extra-args]
../../../gdb/gdb/gdbserver/../common/buffer.c:153:9: error: unknown conversion type character 'l' in format [-Werror=format]
../../../gdb/gdb/gdbserver/../common/buffer.c:153:9: error: too many arguments for format [-Werror=format-extra-args]
cc1.exe: all warnings being treated as errors
make[4]: *** [buffer.o] Error 1
make[4]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild/gdb/gdbserver'
make[3]: *** [subdir_do] Error 1
make[3]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild/gdb'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild'
make: *** [all] Error 2

I see the code change in buffer.c in
Commit:2e01eef6b3e2152435a344c7de3351d4b92525dd

* 2012-05-11  Stan Shebs  <stan@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>


It looks like those format: "%lld"

sprintf (str, "%lld", va_arg (ap, long long));

is not supported under MinGW.

By reading this link:
http://cboard.cprogramming.com/cplusplus-programming/118149-long-long-int-gplusplus-mingw.html

It suggest that under MinGW, we should use %I64d

Any ideas?

Thanks

Yuanhui Zhang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [mingw]gdb CVS HEAD build error
  2012-05-14  1:24 [mingw]gdb CVS HEAD build error asmwarrior
@ 2012-05-14  2:49 ` Eli Zaretskii
  2012-05-14  4:58   ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2012-05-14  2:49 UTC (permalink / raw)
  To: asmwarrior; +Cc: gdb

> Date: Mon, 14 May 2012 09:25:43 +0800
> From: asmwarrior <asmwarrior@gmail.com>
> 
> It looks like those format: "%lld"
> 
> sprintf (str, "%lld", va_arg (ap, long long));
> 
> is not supported under MinGW.

Correct.

> By reading this link:
> http://cboard.cprogramming.com/cplusplus-programming/118149-long-long-int-gplusplus-mingw.html
> 
> It suggest that under MinGW, we should use %I64d
> 
> Any ideas?

Use decimal2str?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [mingw]gdb CVS HEAD build error
  2012-05-14  2:49 ` Eli Zaretskii
@ 2012-05-14  4:58   ` Joel Brobecker
  2012-05-14 15:52     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2012-05-14  4:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: asmwarrior, gdb

> > It suggest that under MinGW, we should use %I64d
> > 
> > Any ideas?
> 
> Use decimal2str?

We have plongest and pulongest which I think are a little more
convenient to use (it's based on decimal2str). Cast to LONGEST
instead of long long, and then pass it to plongest.

Another possible option is to switch to gnulib's printf. I don't know
if gnulib's configury would detect faulty or incomplete versions of
printf like here, so it might not work in this case, but could be worth
a shot.

-- 
Joel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [mingw]gdb CVS HEAD build error
  2012-05-14  4:58   ` Joel Brobecker
@ 2012-05-14 15:52     ` Eli Zaretskii
  2012-05-14 16:16       ` Stan Shebs
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2012-05-14 15:52 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: asmwarrior, gdb

> Date: Sun, 13 May 2012 21:58:08 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: asmwarrior <asmwarrior@gmail.com>, gdb@sourceware.org
> 
> Another possible option is to switch to gnulib's printf. I don't know
> if gnulib's configury would detect faulty or incomplete versions of
> printf like here

This is not an incomplete implementation, it's just that we are using
an unportable format specifier.  We should be using what inttypes.h
says (or use LONGEST and plongest).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [mingw]gdb CVS HEAD build error
  2012-05-14 15:52     ` Eli Zaretskii
@ 2012-05-14 16:16       ` Stan Shebs
  0 siblings, 0 replies; 5+ messages in thread
From: Stan Shebs @ 2012-05-14 16:16 UTC (permalink / raw)
  To: gdb

On 5/14/12 8:53 AM, Eli Zaretskii wrote:
>> Date: Sun, 13 May 2012 21:58:08 -0700
>> From: Joel Brobecker<brobecker@adacore.com>
>> Cc: asmwarrior<asmwarrior@gmail.com>, gdb@sourceware.org
>>
>> Another possible option is to switch to gnulib's printf. I don't know
>> if gnulib's configury would detect faulty or incomplete versions of
>> printf like here
> This is not an incomplete implementation, it's just that we are using
> an unportable format specifier.  We should be using what inttypes.h
> says (or use LONGEST and plongest).
>
Yeah, I'll take care of this, I habitually forget about mingw not liking 
those directives.

Stan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-14 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14  1:24 [mingw]gdb CVS HEAD build error asmwarrior
2012-05-14  2:49 ` Eli Zaretskii
2012-05-14  4:58   ` Joel Brobecker
2012-05-14 15:52     ` Eli Zaretskii
2012-05-14 16:16       ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).