dutil: Add missing string.h header include

Addressing this build warning:

  In file included from /home/acme/git/pahole/dutil.c:10:
  /home/acme/git/pahole/dutil.h: In function ‘strstarts’:
  /home/acme/git/pahole/dutil.h:301:9: warning: implicit declaration of function ‘strncmp’ [-Wimplicit-function-declaration]
    return strncmp(str, prefix, strlen(prefix)) == 0;
           ^~~~~~~
  /home/acme/git/pahole/dutil.h:301:30: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
    return strncmp(str, prefix, strlen(prefix)) == 0;
                                ^~~~~~
  /home/acme/git/pahole/dutil.h:301:30: warning: incompatible implicit declaration of built-in function ‘strlen’
  /home/acme/git/pahole/dutil.h:301:30: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
  /home/acme/git/pahole/dutil.h:20:1:
  +#include <string.h>

  /home/acme/git/pahole/dutil.h:301:30:
    return strncmp(str, prefix, strlen(prefix)) == 0;
                                ^~~~~~

Fixes: a2cdc6c2a0 ("dutil: Adopt strstart() from the linux perf tools sources")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2018-12-26 15:52:26 -03:00
parent 851ef335e3
commit 68b93e6858
1 changed files with 1 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <elf.h>
#include <gelf.h>
#include <asm/bitsperlong.h>