Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • lib
  • dynamic_debug.c
Find file BlameHistoryPermalink
  • Nathan Chancellor's avatar
    lib/dynamic_debug.c: use address-of operator on section symbols · 8306b057
    Nathan Chancellor authored Apr 06, 2020
    
    
    Clang warns:
    
    ../lib/dynamic_debug.c:1034:24: warning: array comparison always
    evaluates to false [-Wtautological-compare]
            if (__start___verbose == __stop___verbose) {
                                  ^
    1 warning generated.
    
    These are not true arrays, they are linker defined symbols, which are just
    addresses.  Using the address of operator silences the warning and does
    not change the resulting assembly with either clang/ld.lld or gcc/ld
    (tested with diff + objdump -Dr).
    
    Suggested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Acked-by: default avatarJason Baron <jbaron@akamai.com>
    Link: https://github.com/ClangBuiltLinux/linux/issues/894
    Link: http://lkml.kernel.org/r/20200220051320.10739-1-natechancellor@gmail.com
    
    
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    8306b057
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7