bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrong 'break' statement when testing if etip.h needs math.h


From: Pierre Labastie
Subject: Wrong 'break' statement when testing if etip.h needs math.h
Date: Sun, 12 Feb 2012 15:38:04 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16

Hi,

When "checking for special defines needed for etip.h", configure uses
a double loop:
----------------------
for cf_math in "" MATH_H
do
for cf_excp in "" MATH_EXCEPTION
do
[short compilation test with -DETIP_NEEDS_${cf_math}
and -DETIP_NEEDS_${cf_excp} if those variables are not empty]
if <no compile error and compiler generated an objet file>
break
else [error message and log]
done
done
[display result and record in confdefs]
-------------------
The break statement only exits the inner loop, so that
even if compilation test passes with 2 variables empty
this is not recorded and the result is MATH_H needed.
Excerpt of config.log:
configure:17630: checking for special defines needed for etip.h
configure:17656: /usr/bin/g++ -c -O2 -I./c++ -I./menu -I./include -D_GNU_SOURCE -DNDEBUG conftest.cc >&5
configure:17659: $? = 0
configure:17662: test -s conftest.o
configure:17665: $? = 0
configure:17656: /usr/bin/g++ -c -O2 -I./c++ -I./menu -I./include -DETIP_NEEDS_MATH_H -D_GNU_SOURCE -DNDEBUG conftest.cc >&5
configure:17659: $? = 0
configure:17662: test -s conftest.o
configure:17665: $? = 0
configure:17686: result: MATH_H

The correction is to use break 2. See attached patch.

Regards,
Pierre Labastie

Attachment: etip_configure.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]