* Re: [RFA/OBVIOUS?] ui_file_new function missing "extern" in header.
[not found] <20105.7837847204$1355819774@news.gmane.org>
@ 2012-12-18 16:27 ` Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2012-12-18 16:27 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> This is both a RFA
Pierre> and a question about:
Pierre> should this be considered as an obvious fix?
Pierre> i.e. shouldn't all functions declared in headers
Pierre> have the extern modifier?
Pierre> Is this mandatory?
It isn't mandatory right now, gdb does it both ways. I don't really
care about this issue so I just tend to use whatever is used nearby. I
think Joel at least has argued for making this part of the gdb style.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFA/OBVIOUS?] ui_file_new function missing "extern" in header.
@ 2012-12-18 8:35 Pierre Muller
2012-12-18 8:47 ` Jan Kratochvil
2012-12-18 8:54 ` Yao Qi
0 siblings, 2 replies; 6+ messages in thread
From: Pierre Muller @ 2012-12-18 8:35 UTC (permalink / raw)
To: gdb-patches
This is both a RFA
and a question about:
should this be considered as an obvious fix?
i.e. shouldn't all functions declared in headers
have the extern modifier?
Is this mandatory?
It doesn't see to change anything in practice, but to me,
it seems like good practice...
... but remember that my C programming knowledge is weak...
Pierre Muller
GDB pascal language maintainer
2012-12-18 Pierre Muller <muller@sourceware.org>
* ui-file.h (tee_file_new): Add extern modifier in header
declaration.
Index: ui-file.h
===================================================================
RCS file: /cvs/src/src/gdb/ui-file.h,v
retrieving revision 1.19
diff -u -p -r1.19 ui-file.h
--- ui-file.h 18 Dec 2012 07:01:58 -0000 1.19
+++ ui-file.h 18 Dec 2012 08:31:00 -0000
@@ -135,7 +135,7 @@ extern struct ui_file *gdb_fopen (char *
/* Create a file which writes to both ONE and TWO. CLOSE_ONE
and CLOSE_TWO indicate whether the original files should be
closed when the new file is closed. */
-struct ui_file *tee_file_new (struct ui_file *one,
+extern struct ui_file *tee_file_new (struct ui_file *one,
int close_one,
struct ui_file *two,
int close_two);
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA/OBVIOUS?] ui_file_new function missing "extern" in header.
2012-12-18 8:35 Pierre Muller
@ 2012-12-18 8:47 ` Jan Kratochvil
2012-12-22 18:57 ` Pierre Muller
2012-12-18 8:54 ` Yao Qi
1 sibling, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2012-12-18 8:47 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
On Tue, 18 Dec 2012 09:35:39 +0100, Pierre Muller wrote:
> i.e. shouldn't all functions declared in headers
> have the extern modifier?
> Is this mandatory?
> It doesn't see to change anything in practice, but to me,
> it seems like good practice...
I agree, it does not change anything. I agree it is probably GNU Coding
Standards do not talk about it so it could be added to gdb/doc/gdbint.texinfo
"Coding Standards".
I am OK with such kind of changes as obvious ones after updating
gdbint.texinfo.
> @@ -135,7 +135,7 @@ extern struct ui_file *gdb_fopen (char *
> /* Create a file which writes to both ONE and TWO. CLOSE_ONE
> and CLOSE_TWO indicate whether the original files should be
> closed when the new file is closed. */
> -struct ui_file *tee_file_new (struct ui_file *one,
> +extern struct ui_file *tee_file_new (struct ui_file *one,
> int close_one,
> struct ui_file *two,
> int close_two);
But in this case you need to reformat the parameters "clone_one" and remaining
ones to still align properly under the opening paren.
Thanks,
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [RFA/OBVIOUS?] ui_file_new function missing "extern" in header.
2012-12-18 8:47 ` Jan Kratochvil
@ 2012-12-22 18:57 ` Pierre Muller
0 siblings, 0 replies; 6+ messages in thread
From: Pierre Muller @ 2012-12-22 18:57 UTC (permalink / raw)
To: 'Jan Kratochvil'; +Cc: gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jan Kratochvil
> Envoyé : mardi 18 décembre 2012 09:47
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA/OBVIOUS?] ui_file_new function missing "extern" in
header.
>
> On Tue, 18 Dec 2012 09:35:39 +0100, Pierre Muller wrote:
> > i.e. shouldn't all functions declared in headers
> > have the extern modifier?
> > Is this mandatory?
> > It doesn't see to change anything in practice, but to me,
> > it seems like good practice...
>
> I agree, it does not change anything. I agree it is probably GNU Coding
> Standards do not talk about it so it could be added to
> gdb/doc/gdbint.texinfo
> "Coding Standards".
>
> I am OK with such kind of changes as obvious ones after updating
> gdbint.texinfo.
>
OK, thus after change to gdbint.texinfo,
I committed this patch as obvious in:
http://sourceware.org/ml/gdb-cvs/2012-12/msg00175.html
I modified the submitted patch to correctly align the parameters of
the following lines, as you suggested.
Thanks Jan,
Pierre Muller
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/OBVIOUS?] ui_file_new function missing "extern" in header.
2012-12-18 8:35 Pierre Muller
2012-12-18 8:47 ` Jan Kratochvil
@ 2012-12-18 8:54 ` Yao Qi
2012-12-18 9:00 ` Jan Kratochvil
1 sibling, 1 reply; 6+ messages in thread
From: Yao Qi @ 2012-12-18 8:54 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
On 12/18/2012 04:35 PM, Pierre Muller wrote:
> i.e. shouldn't all functions declared in headers
> have the extern modifier?
> Is this mandatory?
Better to do that...
> It doesn't see to change anything in practice, but to me,
> it seems like good practice...
> ... but remember that my C programming knowledge is weak...
Tom fixed a bug (gdbserver PR 14917) recently, which is about adding
'extern' in header.
http://sourceware.org/ml/gdb-patches/2012-12/msg00072.html
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-12-22 18:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20105.7837847204$1355819774@news.gmane.org>
2012-12-18 16:27 ` [RFA/OBVIOUS?] ui_file_new function missing "extern" in header Tom Tromey
2012-12-18 8:35 Pierre Muller
2012-12-18 8:47 ` Jan Kratochvil
2012-12-22 18:57 ` Pierre Muller
2012-12-18 8:54 ` Yao Qi
2012-12-18 9:00 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox