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
  • tools
  • testing
  • selftests
  • sigaltstack
  • current_stack_pointer.h
Find file BlameHistoryPermalink
  • Nick Desaulniers's avatar
    selftests: sigaltstack: fix -Wuninitialized · 05107edc
    Nick Desaulniers authored Mar 08, 2023
    
    
    Building sigaltstack with clang via:
    $ ARCH=x86 make LLVM=1 -C tools/testing/selftests/sigaltstack/
    
    produces the following warning:
      warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
      if (sp < (unsigned long)sstack ||
          ^~
    
    Clang expects these to be declared at global scope; we've fixed this in
    the kernel proper by using the macro `current_stack_pointer`. This is
    defined in different headers for different target architectures, so just
    create a new header that defines the arch-specific register names for
    the stack pointer register, and define it for more targets (at least the
    ones that support current_stack_pointer/ARCH_HAS_CURRENT_STACK_POINTER).
    
    Reported-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
    Link: https://lore.kernel.org/lkml/CA+G9fYsi3OOu7yCsMutpzKDnBMAzJBCPimBp86LhGBa0eCnEpA@mail.gmail.com/
    
    
    Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Reviewed-by: default avatarKees Cook <keescook@chromium.org>
    Tested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: default avatarAnders Roxell <anders.roxell@linaro.org>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    05107edc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7