Message ID | 20190918030533.365417-1-simon.marchi@polymtl.ca |
---|---|
State | New |
Headers | show |
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> * ui-file.c: Include cli/cli-style.h.
Simon> (term_cli_styling): Remove cli_styling declaration.
Thanks for doing this.
I think as a rule it's best to always have declarations in a header and
never in the .c code. That way they can be checked against the
definition.
Tom
On 2019-09-18 12:18 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes: > > Simon> * ui-file.c: Include cli/cli-style.h. > Simon> (term_cli_styling): Remove cli_styling declaration. > > Thanks for doing this. > > I think as a rule it's best to always have declarations in a header and > never in the .c code. That way they can be checked against the > definition. Yes, agreed. Actually, I didn't push this patch directly, even though it seemed obvious, because I was wondering if there was some good reason I was missing for not doing it like this in the first place. I pushed it now. Simon
diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 042b13ca3b18..71b74bba1905 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -24,6 +24,7 @@ #include "gdb_obstack.h" #include "gdb_select.h" #include "gdbsupport/filestuff.h" +#include "cli/cli-style.h" null_file null_stream; @@ -106,8 +107,6 @@ ui_file_isatty (struct ui_file *file) static bool term_cli_styling () { - extern int cli_styling; - if (!cli_styling) return false;