Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Jeroen Hofstee's avatar
    0a5051ce
    compiler_gcc: prevent redefining attributes · 0a5051ce
    Jeroen Hofstee authored
    
    The libc headers on FreeBSD and likely related projects as well contain an
    header file, cdefs.h which provides similiar functionality as linux/compiler.h.
    It provides compiler independent defines like __weak __packed, to allow
    compiling with multiple compilers which might have a different syntax for such
    extension.
    
    Since that header file is included in multiple standard headers, like stddef.h
    and stdarg.h, multiple definitions of those defines will be present if both are
    included. When compiling u-boot the compiler will warn about it hundreds of
    times since e.g. common.h will include both files indirectly.
    
    commit 7ea50d52 "compiler_gcc: do not redefine
    __gnu_attributes" prevented such redefinitions, but this was undone by commit
    fb8ffd7c "compiler*.h: sync
    include/linux/compiler*.h with Linux 3.16".
    
    Add the checks back where necessary to prevent such warnings.
    
    As the original patch this checkpatch warning is ignored:
    "WARNING: Adding new packed members is to be done with care"
    
    Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
    Cc: Tom Rini <trini@ti.com>
    Signed-off-by: default avatarJeroen Hofstee <jeroen@myspectrum.nl>
    Acked-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
    0a5051ce
    History
    compiler_gcc: prevent redefining attributes
    Jeroen Hofstee authored
    
    The libc headers on FreeBSD and likely related projects as well contain an
    header file, cdefs.h which provides similiar functionality as linux/compiler.h.
    It provides compiler independent defines like __weak __packed, to allow
    compiling with multiple compilers which might have a different syntax for such
    extension.
    
    Since that header file is included in multiple standard headers, like stddef.h
    and stdarg.h, multiple definitions of those defines will be present if both are
    included. When compiling u-boot the compiler will warn about it hundreds of
    times since e.g. common.h will include both files indirectly.
    
    commit 7ea50d52 "compiler_gcc: do not redefine
    __gnu_attributes" prevented such redefinitions, but this was undone by commit
    fb8ffd7c "compiler*.h: sync
    include/linux/compiler*.h with Linux 3.16".
    
    Add the checks back where necessary to prevent such warnings.
    
    As the original patch this checkpatch warning is ignored:
    "WARNING: Adding new packed members is to be done with care"
    
    Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
    Cc: Tom Rini <trini@ti.com>
    Signed-off-by: default avatarJeroen Hofstee <jeroen@myspectrum.nl>
    Acked-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>