From fc41b0610e5bb204dd9905f89e235ea801e7a4ea Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 9 Jul 2019 21:12:14 +0200 Subject: Make fingerprint handling compatible with LTO Tell the compiler that the fingerprint variable is modified unpredictably. * lib/fingerprint.h (fingerprint): Remove const. * lib/fingerprint.c (fingerprint): Likewise. * src/pdumper.c (Fdump_emacs_portable): Cast fingerprint variable. (pdumper_load): Likewise. * lib-src/make-fingerprint.c (main): Likewise. --- src/pdumper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pdumper.c b/src/pdumper.c index 8b630d221b1..7d29d3c0c83 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4101,7 +4101,8 @@ types. */) ctx->header.magic[0] = '!'; /* Note that dump is incomplete. */ verify (sizeof (fingerprint) == sizeof (ctx->header.fingerprint)); - memcpy (ctx->header.fingerprint, fingerprint, sizeof (fingerprint)); + memcpy (ctx->header.fingerprint, (unsigned char *) fingerprint, + sizeof (fingerprint)); const dump_off header_start = ctx->offset; dump_fingerprint ("dumping fingerprint", ctx->header.fingerprint); @@ -5359,9 +5360,10 @@ pdumper_load (const char *dump_filename) err = PDUMPER_LOAD_VERSION_MISMATCH; verify (sizeof (header->fingerprint) == sizeof (fingerprint)); - if (memcmp (header->fingerprint, fingerprint, sizeof (fingerprint)) != 0) + if (memcmp (header->fingerprint, (unsigned char *) fingerprint, + sizeof (fingerprint)) != 0) { - dump_fingerprint ("desired fingerprint", fingerprint); + dump_fingerprint ("desired fingerprint", (unsigned char *) fingerprint); dump_fingerprint ("found fingerprint", header->fingerprint); goto out; } -- cgit v1.2.1