mirror of
https://review.coreboot.org/flashrom.git
synced 2025-06-30 21:52:36 +02:00
tree: Enable -Wwrite-strings
When compiling, this warning gives string literals the type const char[] to help catch accidental modification (which is undefined behaviour). There currently aren't any instances of this in flashrom, so let's enable this warning to keep it that way. This requires adding const qualifiers to the declarations of several variables that work with string literals. Change-Id: I62d9bc194938a0c9a0e4cdff7ced8ea2e14cc1bc Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/flashrom/+/34577 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
@ -79,7 +79,7 @@ static void cli_classic_abort_usage(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int check_filename(char *filename, char *type)
|
||||
static int check_filename(char *filename, const char *type)
|
||||
{
|
||||
if (!filename || (filename[0] == '\0')) {
|
||||
fprintf(stderr, "Error: No %s file specified.\n", type);
|
||||
|
Reference in New Issue
Block a user