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

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


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

--- Comment #3 from Jeffrey Walton <noloader at gmail.com> 2013-03-05 21:44:18 UTC ---
clang -c libc/sysdeps/linux/common/getdents64.c -o
libc/sysdeps/linux/common/getdents64.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     -MT
libc/sysdeps/linux/common/getdents64.os -MD -MP -MF
libc/sysdeps/linux/common/.getdents64.os.dep



libc/sysdeps/linux/common/getdents64.c:54:10: warning: cast from 'char *' to
      'struct dirent64 *' increases required alignment from 1 to 8
      [-Wcast-align]
    dp = (struct dirent64 *) buf;
         ^~~~~~~~~~~~~~~~~~~~~~~
libc/sysdeps/linux/common/getdents64.c:92:7: warning: cast from 'char *' to
      'struct dirent64 *' increases required alignment from 1 to 8
      [-Wcast-align]
        dp = (struct dirent64 *) ((char *) dp + new_reclen);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libc/sysdeps/linux/common/getdents64.c:93:8: warning: cast from 'char *' to
      'struct kernel_dirent64 *' increases required alignment from 1 to 8
      [-Wcast-align]
        kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 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