Skip to content

BUILD: drmemory build failure caused by strcasestr declaration error #2522

@xdje42

Description

@xdje42

Describe the bug

strcasestr's definition is char *(const char *, const char *) whereas drmemory/common/utils.h uses the older
const char *(const char *, const char *).
This causes a build failure on linux (64-bit, recent vintage).

In file included from /tmp/drmemory/common/utils_shared.c:30:
/usr/include/string.h:380:14: error: conflicting types for ‘strcasestr’; have ‘char *(const char *, const char *)’
  380 | extern char *strcasestr (const char *__haystack, const char *__needle)
      |              ^~~~~~~~~~
In file included from /tmp/drmemory/common/utils_shared.c:28:
/tmp/drmemory/common/utils.h:1015:1: note: previous declaration of ‘strcasestr’ with type ‘\
const char *(const char *, const char *)’
 1015 | strcasestr(const char *text, const char *pattern);
      | ^~~~~~~~~~

To Reproduce

Steps to reproduce the behavior:

$ git clone https://github.com/DynamoRIO/drmemory.git
$ cd drmemory
$ ./make/git/dev-setup.sh
$ cd ..
$ mkdir build
$ cd build
$ cmake ../drmemory
$ make -k # other failures may be present: -k keeps going so that strcasestr failure is seen

Versions

  • What version of Dr. Memory are you using? git head @bfbc4a118a58a182770d306120cad41b9893c53

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions