diff options
author | Julius Werner <jwerner@chromium.org> | 2019-05-07 12:59:47 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-14 20:13:04 -0700 |
commit | 52fa8c11f8e5217e17da74c04e8ad1e5aee9ff40 (patch) | |
tree | a4894fe06a3f1c9fcbbfe728955f75a8de59ed93 /cgpt/cgpt_common.c | |
parent | 88a47ff99952bb4f270a4e80c80c578e39fb9477 (diff) | |
download | vboot-52fa8c11f8e5217e17da74c04e8ad1e5aee9ff40.tar.gz |
Makefile: Enable more warnings for host utilities / tests
This patch adds a bunch of more warnings that are already enabled in
coreboot and thus already enabled for firmware builds anyway (because
coreboot just passes its CFLAGS through). Enabling it in the vboot
Makefile means they also apply to host utilities and tests, which sounds
desirable for consistency.
Fix enough of the cruft and bad coding practices that accumulated over
the years of not having warnings enabled to get it to build again (this
includes making functions static, removing dead code, cleaning up
prototypes, etc.).
Also remove -fno-strict-aliasing from the x86 firmware build options,
because it's not clear why it's there (coreboot isn't doing this, so
presumably it's not needed).
BRANCH=None
BUG=None
TEST=make runtests
Change-Id: Ie4a42083c4770a4eca133b22725be9ba85b24184
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1598721
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'cgpt/cgpt_common.c')
-rw-r--r-- | cgpt/cgpt_common.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c index c129d92d..90fe45a2 100644 --- a/cgpt/cgpt_common.c +++ b/cgpt/cgpt_common.c @@ -327,7 +327,7 @@ int DriveOpen(const char *drive_path, struct drive *drive, int mode, // Clear struct for proper error handling. memset(drive, 0, sizeof(struct drive)); - drive->fd = open(drive_path, mode | + drive->fd = open(drive_path, mode | #ifndef HAVE_MACOS O_LARGEFILE | #endif @@ -677,8 +677,8 @@ const Guid guid_unused = GPT_ENT_TYPE_UNUSED; const static struct { const Guid *type; - char *name; - char *description; + const char *name; + const char *description; } supported_types[] = { {&guid_chromeos_firmware, "firmware", "ChromeOS firmware"}, {&guid_chromeos_kernel, "kernel", "ChromeOS kernel"}, @@ -981,7 +981,7 @@ uint8_t RepairEntries(GptData *gpt, const uint32_t valid_entries) { /* The above five fields are shared between primary and secondary headers. * We can recover one header from another through copying those fields. */ -void CopySynonymousParts(GptHeader* target, const GptHeader* source) { +static void CopySynonymousParts(GptHeader* target, const GptHeader* source) { target->first_usable_lba = source->first_usable_lba; target->last_usable_lba = source->last_usable_lba; target->number_of_entries = source->number_of_entries; @@ -1087,7 +1087,6 @@ void PMBRToStr(struct pmbr *pmbr, char *str, unsigned int buflen) { } /* Optional */ -int __GenerateGuid(Guid *newguid) { return CGPT_FAILED; }; #ifndef HAVE_MACOS -int GenerateGuid(Guid *newguid) __attribute__((weak, alias("__GenerateGuid"))); +__attribute__((weak)) int GenerateGuid(Guid *newguid) { return CGPT_FAILED; }; #endif |