diff options
| author | Roy Marples <roy@marples.name> | 2014-11-11 10:33:28 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-11-11 10:33:28 +0000 |
| commit | cf2469a1523e0c17c34bdc6758ff0cb3380ad3c6 (patch) | |
| tree | 67fffeee05b1d7bb540994b5806a245c61f54eac /configure | |
| parent | e3159b9cc0f7fcb88c9464c80a6616a1c8cccb2c (diff) | |
| download | dhcpcd-cf2469a1523e0c17c34bdc6758ff0cb3380ad3c6.tar.xz | |
If we don't include sys/queue.h directly the clang analyzer complains
about using freed memory.
That seems to be a workaround for this upstream bug:
http://llvm.org/bugs/show_bug.cgi?id=18222
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -660,12 +660,14 @@ int main(void) { EOF if $XCC _queue.c -o _queue 2>&3; then TAILQ_FOREACH_SAFE=yes + TAILQ_FOREACH=yes else TAILQ_FOREACH_SAFE=no fi echo "$TAILQ_FOREACH_SAFE" rm -f _queue.c _queue fi + if [ -z "$TAILQ_CONCAT" ]; then printf "Testing for TAILQ_CONCAT ..." cat <<EOF >_queue.c @@ -679,13 +681,43 @@ int main(void) { EOF if $XCC _queue.c -o _queue 2>&3; then TAILQ_CONCAT=yes + TAILQ_FOREACH=yes else TAILQ_CONCAT=no fi echo "$TAILQ_CONCAT" rm -f _queue.c _queue fi + +if [ -z "$TAILQ_FOREACH" ]; then + printf "Testing for TAILQ_FOREACH ... " + cat <<EOF >_queue.c +#include <sys/queue.h> +int main(void) { +#ifndef TAILQ_FOREACH +#error TAILQ_FOREACH +#endif + return 0; +} +EOF + if $XCC _queue.c -o _queue 2>&3; then + TAILQ_FOREACH=yes + else + TAILQ_FOREACH=no + fi + echo "$TAILQ_FOREACH" + rm -f _queue.c _queue +fi + if [ "$TAILQ_FOREACH_SAFE" = no -o "$TAILQ_CONCAT" = no ]; then + # If we don't include sys/queue.h then clang analyser finds + # too many false positives. + # See http://llvm.org/bugs/show_bug.cgi?id=18222 + # Strictly speaking this isn't needed, but I like it to help + # catch any nasties. + if [ "$TAILQ_FOREACH" = yes ]; then + echo "#include <sys/queue.h>">>$CONFIG_H + fi echo "#include \"compat/queue.h\"">>$CONFIG_H else echo "#include <sys/queue.h>" >>$CONFIG_H |
