DynamoRIO / DynamoRIO/dynamorio
BUILD: drmemory build failure caused by strcasestr declaration error
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
**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 DynamoRIO are you using? git head @bfbc4a118a58a182770d306120cad41b9893c53
Contributor guide
Assessment
This issue has not been assessed yet.