summaryrefslogtreecommitdiff
path: root/misc-utils/flashcp.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-09-21 13:36:42 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-11-02 01:33:32 +0100
commitcb2fcfc0a1da3cfac9094abf1d11c23653937395 (patch)
tree5885e3f6073020ba3b07db35ab2aef73b2726374 /misc-utils/flashcp.c
parent81fd176a6b4958147302ef900f2651c476a3d4e7 (diff)
Add no-return attribute to usage() style functions
A common pattern in command line processing is having a usage() function that prints out how to use the command line options and then terminates. The function is typically used inside a switch block for command line options like `-h' or unknown options. In a lot of places, the break keyword is omitted, because the function exits anyway. However, this triggers gcc warnings about implicit fall-through. Rather than adding a phony "/* fall-through */" this patch flags the usage() style function with a gcc attribute, indicating that they do not return and removes further superfluous break statements. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'misc-utils/flashcp.c')
-rw-r--r--misc-utils/flashcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/flashcp.c b/misc-utils/flashcp.c
index a35e6fc..0718733 100644
--- a/misc-utils/flashcp.c
+++ b/misc-utils/flashcp.c
@@ -81,7 +81,7 @@ static void log_printf (int level,const char *fmt, ...)
fflush (fp);
}
-static void showusage(bool error)
+static NORETURN void showusage(bool error)
{
int level = error ? LOG_ERROR : LOG_NORMAL;