This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
``extern'' in C files; Was: [PATCH RFA] linespec.c: fix no_symtab_msg declaration
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: ``extern'' in C files; Was: [PATCH RFA] linespec.c: fix no_symtab_msg declaration
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 20 Nov 2000 11:54:10 +1100
- References: <1001119041439.ZM7079@ocotillo.lan>
> Index: linespec.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/linespec.c,v
> retrieving revision 1.1
> diff -u -p -r1.1 linespec.c
> --- linespec.c 2000/11/10 23:02:56 1.1
> +++ linespec.c 2000/11/19 03:58:41
> @@ -37,7 +37,7 @@ extern char *find_template_name_end (cha
>
> extern char *operator_chars (char *, char **);
>
> -extern char *no_symtab_msg;
> +extern char no_symtab_msg[];
>
> /* Prototypes for local functions */
>
A generalization as shoving ``extern'' declarations into C files has,
unfortunately, been a common practice :-(
``extern'' declarations in a C files are bad, M'kay :-) The way to fix
it is to move the declaration to a header file (or simply eliminate the
problem, as Jim did :-).
enjoy,
Andrew