From: Stefan Lengfeld <contact@stefanchrist.eu>
To: "Enrico Jörns" <ejo@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/5] commands: nv: fail with verbose message if invoked without args
Date: Wed, 1 Nov 2017 20:43:51 +0100 [thread overview]
Message-ID: <20171101194351.GA476@sill.h.stcim.de> (raw)
In-Reply-To: <646f066b-7219-aec3-7d65-e1b687a40cb4@pengutronix.de>
Hi Enrico,
On Tue, Oct 31, 2017 at 10:47:43PM +0100, Enrico Jörns wrote:
> Hi Lengfeld,
>
> Am 31.10.2017 um 18:51 schrieb Stefan Lengfeld:
> > Hi Jorns,
> >
> > On Mon, Oct 30, 2017 at 11:34:17AM +0100, Enrico Jorns wrote:
> >> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> >> ---
> >> commands/nv.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/commands/nv.c b/commands/nv.c
> >> index 37cdb96647..1c5514dd32 100644
> >> --- a/commands/nv.c
> >> +++ b/commands/nv.c
> >> @@ -56,6 +56,7 @@ static int do_nv(int argc, char *argv[])
> >> argv += optind;
> >>
> >> if (argc < 1)
> >> + printf("Invalid usage: Missing argument");
> >> return COMMAND_ERROR_USAGE;
> >
> > Missing curly brackets for if clause. Indentation does not matter in C
> > as it does in for example python. Now the function returns always
> > 'COMMAND_ERROR_USAGE'.
>
> ouh, you are right, must have lost them while merging the patches too
> quickly.
> But I tried my best to hide it, didn't I?
<joke>
Yeah. Maybe we should start a working group: How to hide non-obvious
functionality in obvious looking patches and invite the 'goto fail;'
guys from apple.
</joke>
Recents version of gcc (>=6) have a compiler warning
'-Wmisleading-indentation' to catch theses errors. [1]
Kind regards
Stefan
[1] https://www.phoronix.com/scan.php?page=news_item&px=GCC6-Misleading-Indentation
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-11-01 19:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 10:34 [PATCH v2 0/5] Fixes for nv command handling Enrico Jorns
2017-10-30 10:34 ` [PATCH 1/5] commands: nv: fail with verbose message if invoked without args Enrico Jorns
2017-10-31 17:51 ` Stefan Lengfeld
2017-10-31 21:47 ` Enrico Jörns
2017-11-01 19:43 ` Stefan Lengfeld [this message]
2017-10-30 10:34 ` [PATCH 2/5] commands: nv: call nvvar_print() only if no argument is given Enrico Jorns
2017-10-30 10:34 ` [PATCH 3/5] commands: nv: assure error code will be returned when an error occurred Enrico Jorns
2017-10-30 10:34 ` [PATCH 4/5] common: globvar: let nvvar_remove() report non-existing variable Enrico Jorns
2017-10-30 10:34 ` [PATCH 5/5] commands: nv: adjust command help Enrico Jorns
2017-10-30 16:51 ` Sam Ravnborg
2017-10-31 21:52 ` Enrico Jörns
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171101194351.GA476@sill.h.stcim.de \
--to=contact@stefanchrist.eu \
--cc=barebox@lists.infradead.org \
--cc=ejo@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox