diff options
author | Eric Sandeen <sandeen@redhat.com> | 2010-12-14 13:00:01 -0600 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-12-16 17:15:30 -0500 |
commit | c816ecb204a32e67788738e050ff2b14a721672b (patch) | |
tree | 61ebd68d1b3e61bc3319a1f8676eec12d307b890 /e2fsck | |
parent | d085f61f25e9e208d99ca6e2c3547ba942033961 (diff) | |
download | e2fsprogs-c816ecb204a32e67788738e050ff2b14a721672b.tar.gz |
e2fsprogs: fix type-punning warnings
Flags used during RHEL/Fedora builds lead to a couple type-punning
warnings:
recovery.c: In function 'do_one_pass':
recovery.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
./csum.c: In function 'print_csum':
./csum.c:170: warning: dereferencing type-punned pointer will break strict-aliasing rules
The two changes below fix this up.
Note that the csum test binary output changes slightly, but this does
not break any tests.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/recovery.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c index 8e405756..cac9294c 100644 --- a/e2fsck/recovery.c +++ b/e2fsck/recovery.c @@ -536,8 +536,10 @@ static int do_one_pass(journal_t *journal, memcpy(nbh->b_data, obh->b_data, journal->j_blocksize); if (flags & JFS_FLAG_ESCAPE) { - *((__be32 *)nbh->b_data) = - cpu_to_be32(JFS_MAGIC_NUMBER); + journal_header_t *header; + + header = (journal_header_t *) &nbh->b_data[0]; + header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); } BUFFER_TRACE(nbh, "marking dirty"); |