implicit declaration using -std=c99

后端 未结 4 639
后悔当初
后悔当初 2020-12-06 05:03

I\'m getting this warning: (-std=c99 -pedantic)

warning: implicit declaration of function ‘strndup’ [-Wimplicit-function-declaration]

4条回答
  •  甜味超标
    2020-12-06 05:42

    strndup is a GNU extension, so you need to compile with -D_GNU_SOURCE on the command line, or stick a #define _GNU_SOURCE 1 in your source files before the #include lines

提交回复
热议问题