[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Identical function names in bash source code
From: |
Eduardo A . Bustamante López |
Subject: |
Re: Identical function names in bash source code |
Date: |
Sat, 5 Jan 2019 09:15:29 -0800 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sat, Jan 05, 2019 at 08:19:38AM -0600, Peng Yu wrote:
> Hi,
>
> It is not uncommon to see the same name is used to defined functions
> in different .c files in bash source code.
>
> For example, sh_single_quote is defined in both lib/readline/shell.c
> and lib/sh/shquote.c with the exact same signature. The two pieces of
> code are slightly different. Do they do the exact same things or do
> something different?
>
> In either case, is having the same name for different functions a good
> practice? This will make the linked binary dependent on the order of
> the corresponding .a files specified. Or if linked via .o files, then
> one function will shadow the others. See 1) and 2) below for minimal
> working examples. Neither cases seem to be good and could be avoided
> easily by giving the functions unique names.
>
> So, should such functions with the same name be named differently? Thanks.
This mailing list (bug-bash) is for reporting BUGS. If you must, at least please
use help-bash for generic questions?
Although you should probably be asking this to a C programming forum...
Re: Identical function names in bash source code, Chet Ramey, 2019/01/06