[Bug 6068] Enhancement: Add warning -Wcast-align for GCC

bugzilla at busybox.net bugzilla at busybox.net
Tue Mar 5 21:41:21 UTC 2013


https://bugs.busybox.net/show_bug.cgi?id=6068

--- Comment #1 from Jeffrey Walton <noloader at gmail.com> 2013-03-05 21:42:03 UTC ---
clang -c ldso/ldso/ldso.c -o ldso/ldso/ldso.oS -include
./include/libc-symbols.h -Wall -Wstrict-prototypes -Wstrict-aliasing -Wformat=2
-Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wnonnull -Wold-style-definition
-Wshadow -Wundef -Wdeclaration-after-statement -funsigned-char -fno-builtin
-fno-asm -std=gnu99 -fno-stack-protector -nostdinc -I./include -I./include -I.
-I./libc/sysdeps/linux -I./libc/sysdeps/linux/x86_64  -Os -funit-at-a-time
-fmerge-all-constants -fstrict-aliasing -Wcast-align -fno-common
-I./libc/sysdeps/linux/common -I/usr/src/linux-headers-3.2.0-38/include/
-isystem /usr/local/bin/../lib/clang/3.1/include-fixed -isystem
/usr/local/bin/../lib/clang/3.1/include -DNDEBUG -fPIC -DSHARED -DNOT_IN_libc
-DIS_IN_rtld -fno-stack-protector -fno-omit-frame-pointer -I./ldso/ldso/x86_64
-I./ldso/include -I./ldso/ldso
-DUCLIBC_RUNTIME_PREFIX=\"/usr/x86_64-linux-uclibc/\"
-DUCLIBC_LDSO=\"ld64-uClibc.so.0\"  -DLDSO_ELFINTERP=\"x86_64/elfinterp.c\"
-DNOT_IN_libc -DIS_IN_rtld -fno-stack-protector -fno-omit-frame-pointer
-I./ldso/ldso/x86_64 -I./ldso/include -I./ldso/ldso
-DUCLIBC_RUNTIME_PREFIX=\"/usr/x86_64-linux-uclibc/\"
-DUCLIBC_LDSO=\"ld64-uClibc.so.0\"  -MT ldso/ldso/ldso.oS -MD -MP -MF
ldso/ldso/.ldso.oS.dep



./ldso/ldso/x86_64/elfinterp.c:61:15: warning: cast from 'char *' to
      'Elf64_Rela *' increases required alignment from 1 to 8 [-Wcast-align]
        this_reloc = (ELF_RELOC *)(rel_addr + reloc_entry);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ldso/ldso/ldso.c:93:
./ldso/ldso/dl-startup.c:200:15: warning: cast from 'unsigned char (*)[16]' to
      'uint32_t *' (aka 'unsigned int *') increases required alignment from 1
to
      4 [-Wcast-align]
                        || *(p32 = (uint32_t*)&header->e_ident) != ELFMAG_U32
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ldso/ldso/ldso.c:1432:
./ldso/ldso/dl-elf.c:68:11: warning: cast from 'caddr_t' (aka 'char *') to
      'header_t *' increases required alignment from 1 to 4 [-Wcast-align]
        header = (header_t *) _dl_cache_addr;
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./ldso/ldso/dl-elf.c:270:22: warning: cast from 'caddr_t' (aka 'char *') to
      'header_t *' increases required alignment from 1 to 4 [-Wcast-align]
                header_t *header = (header_t *) _dl_cache_addr;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./ldso/ldso/dl-elf.c:513:8: warning: cast from 'unsigned char (*)[16]' to
      'uint32_t *' (aka 'unsigned int *') increases required alignment from 1
to
      4 [-Wcast-align]
        p32 = (uint32_t*)&epnt->e_ident;
              ^~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list