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: [PATCH v3 8/9] compile: New compile printf


On 05/06/2015 12:29 PM, Jan Kratochvil wrote:
> On Wed, 06 May 2015 12:22:41 +0200, Pedro Alves wrote:
>> I understand that.  But what I was asking is (after the series is wholly
>> pushed), what is the advantage of "(gdb) compile printf"
>> over "(gdb) compile print printf (...)" and "(gdb) call printf (...)".
> 
> This patch, that is
> 	[PATCH v3 8/9] compile: New compile printf
> without the part
> 	[PATCH v3 9/9] compile: compile printf: gdbserver support
> is really just that
> 	(gdb) compile print printf (...)
> and the patch is also therefore very simple.
> 
> According to Phil - roughly, not citing - such 'compile printf' was simple
> enough to code to make it worth such a feature, despite it has many
> shortcomings.

OK, since we don't have a real use case of calling the
inferior's printf (other than because it's seemingly simple), I'd
rather we avoid it and do as outlined in the previous email.

>> Agreed on the latter, but the question really is: why do we need
>> "set compile-printf-args" instead of using "set compile-args" for
>> all expression evaluation through the compiler?
>> Shouldn't "-Werror=format" be in "set compile-args" too?
> 
> Why not, this is a matter of opinion.  IMO cc itself should have -Werror by
> default as otherwise by default it is willing to knowingly produce crashing
> programs.  The only safe warnings are -Wunused* ones and maybe few others.
> So again, this patch tries to make minimal changes to what is the current
> established wrong standard.

The minimal change then is putting -Werror=format in "set compile-args".
Sounds like you're OK with that; let's do it.

Thanks,
Pedro Alves


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