2006-07-05 Roland Levillain <roland(a)lrde.epita.fr>
Fix some tests using ntg::range.
* tests/types/tests/float_r2, tests/types/tests/range2,
* tests/types/tests/range2b: Fix tests.
Index: 10.230/integre/tests/types/tests/float_r2
--- 10.230/integre/tests/types/tests/float_r2 Tue, 20 Apr 2004 15:16:21 +0200 van-vl_n (oln/h/11_float_r2 1.3 600)
+++ 10.230(w)/integre/tests/types/tests/float_r2 Tue, 04 Jul 2006 14:13:52 +0200 levill_r (oln/h/11_float_r2 1.3 600)
@@ -28,4 +28,8 @@
typedef range<float_s, bounded_s<10, 20>, strict> sr;
sr f = 23.0; // ABORT
-(void) f;
+/* Make as if `f' is actually used. As we can't cast `f' to `void'
+ here (since it would produce an error in
+ `ntg::range<T, interval, behavior>::operator U()', we assign `f' to
+ itself. */
+f = f;
Index: 10.230/integre/tests/types/tests/range2b
--- 10.230/integre/tests/types/tests/range2b Tue, 20 Apr 2004 15:16:21 +0200 van-vl_n (oln/h/36_range2b 1.2 600)
+++ 10.230(w)/integre/tests/types/tests/range2b Tue, 04 Jul 2006 14:18:29 +0200 levill_r (oln/h/36_range2b 1.2 600)
@@ -27,4 +27,8 @@
// Public License.
range<int_u8, bounded_u<10, 13> > u = 14; // ABORT
-(void) u;
+/* Make as if `u' is actually used. As we can't cast `u' to `void'
+ here (since it would produce an error in
+ `ntg::range<T, interval, behavior>::operator U()', we assign `u' to
+ itself. */
+u = u;
Index: 10.230/integre/tests/types/tests/range2
--- 10.230/integre/tests/types/tests/range2 Tue, 20 Apr 2004 15:16:21 +0200 van-vl_n (oln/h/33_range2 1.2 600)
+++ 10.230(w)/integre/tests/types/tests/range2 Tue, 04 Jul 2006 14:17:13 +0200 levill_r (oln/h/33_range2 1.2 600)
@@ -27,4 +27,8 @@
// Public License.
range<int_u8, bounded_u<10, 13>, strict> u = 14; // ABORT
-(void) u;
+/* Make as if `u' is actually used. As we can't cast `u' to `void'
+ here (since it would produce an error in
+ `ntg::range<T, interval, behavior>::operator U()', we assign `u' to
+ itself. */
+u = u;
On 2006-07-04, Roland Levillain <roland(a)lrde.epita.fr> wrote:
>
> Fix C++ compiler identification.
>
> * config/oln.m4 (AC_CXX_FLAGS): Check for the Intel C++ compiler
> before the GNU C++ compiler.
>
>
> Index: 10.227/config/oln.m4
> --- 10.227/config/oln.m4 Fri, 30 Jun 2006 16:51:46 +0200 levill_r (oln/j/15_oln.m4 1.38.1.12 600)
> +++ 10.227(w)/config/oln.m4 Tue, 04 Jul 2006 11:33:53 +0200 levill_r (oln/j/15_oln.m4 1.38.1.12 600)
> @@ -465,15 +465,19 @@
> # specifications.
>
> # This macro checks for the following compilers :
> +# - Intel C++ (icpc)
> # - GNU C++ (g++)
> # - Sun WorkShop C++ (Sun/CC)
> -# - Intel C++ (icc)
> # - Comeau C++ (como)
> # and sets the following autoconf variables:
> # CXXFLAGS_DEBUG
> # CXXFLAGS_STRICT
> # CXXFLAGS_STRICT_ERRORS
> # CXXFLAGS_OPTIMIZE
> +#
> +# The Intel C++ compiler is checked before the GNU C++ compiler,
> +# because our test for the latter recognizes the former as G++ (i.e.,
> +# icpc defines __GNUC__). Perhaps we should use another test for G++.
>
First off, I thought about using __GNUG__ but icpc also defines it :(
__GNUG__
The GNU C compiler defines this when the compilation language is C++; use
`__GNUG__' to distinguish between GNU C and GNU C++.
icpc defines the following:
#define __GNUG__ 3
#define __GNUC__ 4
#define __GNUC_MINOR__ 0
#define __VERSION__ "Intel(R) C++ gcc 3.0 mode"
How about grepping the result of icpc -E?
<<<< test.cc <<<<
__VERSION__
>>>>>>>>>>>>>>>>>
if icpc -E test.cc | grep -i intel >/dev/null; then
echo 'ICPC'
else
echo 'Try something else :)'
fi
--
SIGOURE Benoit aka Tsuna
_____
/EPITA\ Promo 2008.CSI Rock & tRoll
2006-07-04 Roland Levillain <roland(a)lrde.epita.fr>
Fix C++ compiler identification.
* config/oln.m4 (AC_CXX_FLAGS): Check for the Intel C++ compiler
before the GNU C++ compiler.
Index: 10.227/config/oln.m4
--- 10.227/config/oln.m4 Fri, 30 Jun 2006 16:51:46 +0200 levill_r (oln/j/15_oln.m4 1.38.1.12 600)
+++ 10.227(w)/config/oln.m4 Tue, 04 Jul 2006 11:33:53 +0200 levill_r (oln/j/15_oln.m4 1.38.1.12 600)
@@ -465,15 +465,19 @@
# specifications.
# This macro checks for the following compilers :
+# - Intel C++ (icpc)
# - GNU C++ (g++)
# - Sun WorkShop C++ (Sun/CC)
-# - Intel C++ (icc)
# - Comeau C++ (como)
# and sets the following autoconf variables:
# CXXFLAGS_DEBUG
# CXXFLAGS_STRICT
# CXXFLAGS_STRICT_ERRORS
# CXXFLAGS_OPTIMIZE
+#
+# The Intel C++ compiler is checked before the GNU C++ compiler,
+# because our test for the latter recognizes the former as G++ (i.e.,
+# icpc defines __GNUC__). Perhaps we should use another test for G++.
AC_DEFUN([AC_CXX_FLAGS],
[dnl
@@ -482,7 +486,10 @@
AC_CACHE_CHECK([for C++ compiler-specific extra flags],
[ac_cv_cxx_style],
[ac_cv_cxx_style=unknown
- if test "x$ac_compiler_gnu" != xno; then
+ if $CXX -V 2>&1 | grep -i "Intel(R) C++">/dev/null 2>&1;
+ then
+ ac_cv_cxx_style=Intel
+ elif test "x$ac_compiler_gnu" != xno; then
[case `$CXX --version` in
*3.[2-9]* | \
*[4-9].* )
@@ -492,9 +499,6 @@
esac]
elif $CXX -V 2>&1 | grep -i "WorkShop">/dev/null 2>&1; then
ac_cv_cxx_style=Sun
- elif $CXX -V 2>&1 | grep -i "Intel(R) C++">/dev/null 2>&1;
- then
- ac_cv_cxx_style=Intel
else
echo "int main() {}" >conftest.cc
if $CXX --version conftest.cc 2>&1 \