Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4363
Closed
Open
Issue created Jul 08, 2020 by Administrator@rootContributor

gcc 10.1.0 snprintf warning

Created by: Biswa96

This project can not be built in Linux due to usage of same buffer in source and destination in snprintf(). Here are the points:

  • System: ArchLinux X86_64
  • Compiler: gcc version 10.1.0 (GCC) Target: x86_64-pc-linux-gnu
  • Source version: latest master branch
  • Used command: mkdir build; cd build; cmake ../dynamorio/; make
  • Compiler error:
In file included from dynamorio/tools/drdeploy.c:67:
dynamorio/tools/drdeploy.c: In function ‘append_client’:
dynamorio/libutil/dr_frontend.h:108:23: error: ‘snprintf’ argument 4 may overlap destination object ‘client_paths’ [-Werror=restrict]
  108 | #    define _snprintf snprintf
dynamorio/tools/drdeploy.c:751:9: note: in expansion of macro ‘_snprintf’
  751 |         _snprintf(client_paths[index], BUFFER_SIZE_ELEMENTS(client_paths[index]), "%s",
      |         ^~~~~~~~~
dynamorio/tools/drdeploy.c:737:20: note: destination object referenced by ‘restrict’-qualified argument 1 was declared here
  737 |               char client_paths[MAX_CLIENT_LIBS][MAXIMUM_PATH],
      |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Assignee
Assign to
Time tracking