Re: [PATCH v2 8/9] rebase -i: learn to abbreviate command names
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 27, 2017, 19:15 UTC
- Message-ID
- <xmqqmv24m186.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACsJy8B3U0_sJeEt+gLy9HJKszO5-uRZsssL3ZFdkKbSM9yWDg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 15 quoted lines
> On Mon, Dec 4, 2017 at 5:17 AM, Liam Beguin <liambeguin@gmail.com> wrote:
>> +static const char command_to_char(const enum todo_command command)
>> +{
>> + if (command < TODO_COMMENT && todo_command_info[command].c)
>> + return todo_command_info[command].c;
>> + return comment_line_char;
>> +}
>
> CC sequencer.o
> sequencer.c:798:19: error: type qualifiers ignored on function return
> type [-Werror=ignored-qualifiers]
> static const char command_to_char(const enum todo_command command)
> ^
>
> Maybe drop the first const.Thanks. This topic has been in 'next' for quite some time and I wanted to merge it down to 'master' soonish, so I've added the following before doing so.
-- >8 -- From: Junio C Hamano <gitster@pobox.com> Date: Wed, 27 Dec 2017 11:12:45 -0800 Subject: [PATCH] sequencer.c: drop 'const' from function return type
With -Werror=ignored-qualifiers, a function that claims to return "const char" gets this error:
CC sequencer.o
sequencer.c:798:19: error: type qualifiers ignored on function return
type [-Werror=ignored-qualifiers]
static const char command_to_char(const enum todo_command command)
^Reported-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sequencer.c b/sequencer.c index 115085d39c..2a407cbe54 100644 --- a/sequencer.c +++ b/sequencer.c @@ -795,7 +795,7 @@ static const char *command_to_string(const enum todo_command command) die("Unknown command: %d", command); } -static const char command_to_char(const enum todo_command command) +static char command_to_char(const enum todo_command command) { if (command < TODO_COMMENT && todo_command_info[command].c) return todo_command_info[command].c;
-- 2.15.1-597-g62d91a8972